n=int(input())
list=[]
if n%2==0:
    list.append(2)
if n%3==0:
    list.append(3)
if n%7==0:
    list.append(7)
sorted(list)
if len(list)==0:
    print("n")
else:
    for i in list:
        print(i,end=" ")