import math
l = []


def primeFactors(n):
    global l
    while n % 2 == 0:
        l.append(2)
        n = n // 2
    for i in range(3, int(math.sqrt(n))+1, 2):
        while n % i == 0:
            l.append(i)
            n = n // i
    if n > 2:
        l.append(n)


n = int(input())
primeFactors(n)
if len(l) < 2:
    if not len(l):
        l.append(1)
    print(1, *l)
elif len(l) == l.count(l[0]) == 2:
    print(1, l[0])
elif len(l) == 2:
    print(*l, sep=" ")
else:
    l.sort()
    flag = False
    left = right = 1
    while len(l) > 1:
        if not flag:
            left = l.pop(0) * l.pop(-1)
            flag = not flag
        else:
            right = l.pop(0) * l.pop(-1)
            flag = not flag
    if len(l):
        if left < right:
            left *= l[0]
        else:
            right *= l[0]
    print(max(left, right))
