ss = int(input()) s = ss ans = [] z = 4**70 while s >= 10**17: while s >= z: s -= z ans.append(z) z //= 4 import math while s >= 1: x = math.floor(math.sqrt(s)) ans.append(x**2) s -= x**2 while sum(ans) != ss: ans.append(1) print(len(ans)) print(*ans)