s = int(input()) ans = [] while s: t = int(s ** 0.5) if t * t > s: t -= 1 s -= t * t ans.append(t * t) print(len(ans)) print(*ans)