n = int(input()) ans=[] def judge(x): if x**2 <= n: return 1 else: return 0 while n > 1: ok=0 ng=10**18 while ng-ok > 1: mid = (ng+ok)//2 if judge(mid): ok = mid else: ng = mid #print(ok) ans.append(ok) n = n - ok**2 if n % 2 : ans.append(1) print(len(ans)) print(*ans) else: print(len(ans)) print(*ans)