import sys
import math

n = int(sys.stdin.read().strip())
factor = []

#1.先从2开始
while n % 2 == 0:                   #除到不能除为止
    factor.append(2)
    n //= 2

#2.除2以外的质数因子都是奇数
i = 3
while i * i <= n:
    while n % i == 0:
        factor.append(i)
        n //= i
    i += 2

#3.如果还剩一个数且它大于1,则它一定是质数因子
if n > 1:
    factor.append(n)

print(" ".join(map(str, factor)))