import math

n = int(input())

for x in range(2, int(math.sqrt(n))+1): # 不大于平方根
    while n % x == 0:   # 思路就是一个一个地除,从小到大,除重复的直到没法除了,再往后除
        n = n // x
        print(x, end=' ')

if n >=2: # 循环过后n只能为0,1,或者质数本身,因为如果是大于2,只会停留在上面的while循环里
    print(n)