m = int(input()) if m == 0: print(1) print(1) exit() def e(n): #O(NloglogN) l = [True]*(n+1) l[0] = False l[1] = False for i in range(2,n): if l[i]: for p in range(i+i,n+1,i): l[p] = False return l t = e(10**5) pn = [] for i in range(2, 10**5): if t[i]: pn.append(i) now = 0 left = m bits = [] while left: if left & 1: bits.append(now) left >>= 1 now += 1 from collections import deque que = deque(pn) koho = [] for i in bits[::-1]: pn = que.popleft() for j in range(i): koho.append(pn) koho.append(que.pop()) ans = set() koho.sort(key = lambda x:-x) for i in koho: if i not in ans: ans.add(i) else: ans.add(i*que.popleft()) print(len(ans)) print(*ans)