S = int(input()) ans = [] while S: e = S + 1 s = 1 while e - s > 1: m = e + s >> 1 if m * m > S: e = m else: s = m ans.append(s * s) S -= s * s print(len(ans)) print(*ans)