S = int(input()) T = [] def f(X): if X == 0 and len(T) <= 15: print(len(T)) print(*T) exit() if len(T) > 15: return a = int(X**0.5) for i in range(a, 0, -1): T.append(i*i) f(X - i*i) T.pop() f(S)