n = int(input())
factors = []

# 处理2的因子
while n % 2 == 0:
    factors.append(2)
    n = n // 2

# 处理奇数因子
i = 3
max_factor = int(n**0.5) + 1
while i <= max_factor:
    while n % i == 0:
        factors.append(i)
        n = n // i
        max_factor = int(n**0.5) + 1
    i += 2

# 如果剩下的n是大于1的质数
if n > 1:
    factors.append(n)

# 输出结果
print(' '.join(map(str, factors)))