N=int(input()) if N<=2: print(1) else: ans=[] for i in range(2,N+1): m=0 for j in range(2,int(i**(1/2))+1): if i%j==0: m+=1 break if m==0: ans.append(i) print(*ans)