n = int(input())

lst = []

for i in (2,3,7):
    if n % i == 0:
        lst.append(str(i))

print('n') if not lst else print(' '.join(lst))