O=int(input())
for V in range(2,O+1):
    if(O%V==0):
        c=0
        for k in range(1,V+1):
            if(V%k==0):
                c=c+1
        if(c==2):
            print(k,end=" ")

cb9b584d22a04212855ec873e413e16241cb4ad8
<mask token>

<mask token>
for V in range(2, O + 1):
    if O % V == 0:
        c = 0
        for k in range(1, V + 1):
            if V % k == 0:
                c = c + 1
        if c == 2:
            print(k, end=' ')

O = int(input())
for V in range(2, O + 1):
    if O % V == 0:
        c = 0
        for k in range(1, V + 1):
            if V % k == 0:
                c = c + 1
        if c == 2:
            print(k, end=' ')

O=int(input())
for V in range(2,O+1):
    if(O%V==0):
        c=0
        for k in range(1,V+1):
            if(V%k==0):
                c=c+1
        if(c==2):
            print(k,end=" ")
