def myfunction(x):
    abc = []
    if x <= 1:
        return []
    i = 2
    count = 0
    while i*i <= x:
        if x % i == 0:
            count += 1
            abc += [i] + myfunction(x//i)
            break
        i += 1
    if count == 0:
        abc.append(x)
    abc.sort()
    return abc

while True:
    try:
        a = int(input())
        b = myfunction(a)
        print(*b)
    except:
        break