import sys input = sys.stdin.readline def isqrt(n): if n == 0: return 0 x = 1 << (n.bit_length() + 1) // 2 y = (x + n // x) // 2 while y < x: x = y y = (x + n // x) // 2 return x S = int(input()) ans = [] now = S while now!=0: tmp = isqrt(now) ans.append(tmp**2) now -= tmp**2 print(len(ans)) print(*ans)