'''
方法一:
2|________180_________2|_____90________
3|___45_______
3|__15_____
5|__5__
1
'''
i = int(input())
tem = []
for k in range(2,int(i**0.5)+1):
while i%k == 0:
tem.append(k)
i = i//k
if i != 1:
tem.append(i)
print(' '.join(map(str,sorted(tem))))
'''
方法二
2|________180_________2|_____90________
3|___45_______
3|__15_____
5
函数迭代法:
def QZS(n):
for k in range(2,int(n**0.5)+1):##int直接抹去小数,不是四舍五入
if n % k == 0:
print(k, end=' ')
n = n//k
QZS(n)
break
if k == int(n**0.5) and n % k != 0:
print(n,end=' ')
QZS(a)
'''