using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); static long[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var s = long.Parse(ReadLine()); var ans = new List(); while (s > 0) { var sq = Square(s); ans.Add(sq); s -= sq; } WriteLine(ans.Count); WriteLine(string.Join(" ", ans)); } static long Square(long s) { var ok = 1L; var ng = 1_000_000_001L; while (ng - ok > 1) { var mid = (ok + ng) / 2; if (mid * mid <= s) ok = mid; else ng = mid; } return ok * ok; } }