n = int(input())

def judge(number):
    if number<=1:
        return False
    for i in range(2,number//2+1):
        if number%i == 0:
            return False
    return True


if n==2 or n==3:
    print(n,end = ' ')
else:
    r = 2
    is_prime = True
    while n >= 2:
        if n%r==0:
            if is_prime:
                print(r, end = ' ')
                n = n//r
            else:
                is_prime = judge(r)
        else:
            r += 1