n=int(input()) ans=[] for i in range(1,10**9+1)[::-1]: while i*i<=n: n-=i*i ans.append(i*i) print(len(ans)) print(*ans)