num = int(input())
lst = []
i = 1
while i < num // 2 and i not in lst:
if num % i == 0:
print(i, num // i)
lst.append(num // i)
i += 1
num = int(input())
lst = []
i = 1
while i < num // 2 and i not in lst:
if num % i == 0:
print(i, num // i)
lst.append(num // i)
i += 1