n = int(input()) ans = [] while n > 0: x = int(n**0.5) while x * x < n: x += 1 while x * x > n: x -= 1 ans.append(x * x) n -= x * x print(len(ans)) print(*ans)