S=int(input()) ans=[] for _ in range(15): x=int(S**0.5) while (x+1)**2 <= S: x+=1 ans.append(x**2) S-=x**2 if S==0:break print(len(ans)) print(*ans)