#include #include #include #include #include #include #include using namespace std; typedef long long ll; int N; int d[300001]; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; cin >> N; for(int i = 1; i <= N; i++) d[i] = 1e7; for(int i = 0; i < N; i++){ for(int j = 1; i+j*j <= N; j++){ d[i+j*j] = min(d[i]+j, d[i+j*j]); } } int cur = N; vector v, u; for(int i = 1; i*i <= N; i +=2 ) v.push_back(i); for(int i = 2; i*i <= N; i += 2) u.push_back(i); for (auto itr = rbegin(u); itr != rend(u); itr++) v.push_back(*itr); int tmp = 0; for(int i : v){ while(true){ if(cur == 0) break; if(cur-i*i < 0) break; if(d[cur-i*i]+i != d[cur]) break; cur -= i*i; for(int j = 0; j < i; j++) cout << (char)('0'+(tmp^(j%2))); if(i%2 == 0) tmp ^= 1; } } cout << endl; }