#N,Q=map(int, input().split())
N=int(input())
ans=[]
while N:
  ok,ng=0,10**10
  for i in range(50):
    mid=(ok+ng)//2 
    if mid**2>N:
      ng=mid
    else:
      ok=mid 
  N-=ok**2 
  ans.append(ok**2)
print(len(ans))
print(*ans)