#include using namespace std; long long sqr(long long x) { long long ret = sqrt(x); if(ret * ret > x) { ret--; } if((ret + 1) * (ret + 1) <= x) { ret++; } return ret; } vector ans; bool ok = false; void dfs(long long S, vector v) { if(ok) { return; } if(S == 0) { ans = v; ok = true; return; } if((int) v.size() > 15) { return; } long long T = sqr(S); for(int i = 0; i < 3; i++) { if(T - i > 0) { vector nv = v; nv.emplace_back((T - i) * (T - i)); dfs(S - (T - i) * (T - i), nv); } } } int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(false); long long S; cin >> S; dfs(S, vector{}); cout << (int) ans.size() << '\n'; for(int i = 0; i < (int) ans.size(); i++) { cout << ans[i] << " \n"[i == (int) ans.size() - 1]; } return 0; }