#define _USE_MATH_DEFINES #include using namespace std; //template #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(a);i>(b);i--) #define ALL(v) (v).begin(),(v).end() typedef long long int ll; typedef pair P; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } templatevoid Fill(A(&array)[N],const T &val){fill((T*)array, (T*)(array+N), val);} const int inf = INT_MAX / 2; const ll INF = LLONG_MAX / 2; //template end vector> sq;int n,d,rt; void init(){ int mi=inf; rep(i,0,550)rep(j,0,550)rep(k,0,550){ d=n-i*i-j*j-k*k; if(d<0)continue; rt=sqrt(d); if(rt*rt==d&&(mi==i+j+k+rt||chmin(mi,i+j+k+rt))){ sq.push_back({i,j,k,rt}); } } } int main(){ scanf("%d",&n); init(); int mi=inf; rep(i,0,sq.size())chmin(mi,sq[i][0]+sq[i][1]+sq[i][2]+sq[i][3]); rep(i,0,sq.size())sort(ALL(sq[i])); string ans; rep(j,0,sq.size())if(accumulate(ALL(sq[j]),0LL)==mi){ do{ string sub; char c='0'; rep(rot,0,4)rep(i,0,sq[j][rot]){ if(i){ if(c=='0')c='1'; else c='0'; } sub+=c; } if(ans=="")ans=sub; else chmin(ans,sub); } while (next_permutation(ALL(sq[j]))); } cout<