K=int(input()) prime=[True for _ in range(1000001)] prime[0]=False prime[1]=False for i in range(2,1000001): if prime[i]: cnt=2 while i*cnt<1000001: prime[i*cnt]=False cnt+=1 ans2=0 ansp=0 for i in range(1,250): for j in range(1,250): if i*j==K and i+j<=250: ans2=i ansp=j ans=[2]*ans2 for i in range(999999): if ansp==0: break if prime[i] and prime[i+2]: ans.append(i) ansp-=1 print(len(ans)) print(*ans)