#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}
inline double time() {
    return static_cast<long double>(chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9;
}


int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll s; cin >> s;
    vector<ll> a;
    while (s) {
        ll t = sqrt(s);
        while ((t+1)*(t+1) <= s) t += 1;
        while (t*t > s) t--;
        a.push_back(t*t);
        s -= t*t;
    }
    cout << a.size() << endl;
    for (int i = 0; i < a.size(); ++i) {
        cout << a[i] << " ";
    }
    cout << endl;
}