#include using namespace std; using ll=long long; ll bs(ll s){ ll ok=1,ng=2e9; while(abs(ok-ng)>1){ ll mid=(ok+ng)/2; if(mid*mid<=s){ ok=mid; }else{ ng=mid; } } return ok; } int main(){ ll s; cin>>s; vector a; while(s){ ll val=bs(s); s-=val*val; a.push_back(val*val); } cout<