#include #define rep(i, a, n) for(int i = a; i < n; i++) #define int long long using namespace std; typedef pair P; const int mod = 1000000007; const int INF = 1e18; int dp[300010], prv[300010]; signed main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; for(int i = 0; i <= n; i++){ dp[i] = i; prv[i] = 1; } for(int i = 2; i * i <= n; i++){ for(int j = 0; j <= n - i * i; j++){ // cout << i << ' ' << j << endl; if(dp[j + i * i] > dp[j] + i){ dp[j + i * i] = dp[j] + i; prv[j + i * i] = i; // cout << " " << dp[j + i * i] << endl; } } } vector a; int now = n; while(now != 0){ a.push_back(prv[now]); now = now - prv[now] * prv[now]; } vector odd, even; for(auto i : a){ if(i % 2) odd.push_back(i); else even.push_back(i); } sort(odd.begin(), odd.end()); sort(even.begin(), even.end()); vector tmp(even.size()); rep(i, 0, even.size()){ if(i % 2 == 0){ tmp[i] = even[even.size() - 1 - i / 2]; }else{ tmp[i] = even[i / 2]; } } even = tmp; a.clear(); for(auto i : odd) a.push_back(i); for(auto i : even) a.push_back(i); string ans = ""; int cnt = 0; for(auto i : a){ rep(j, 0, i){ ans += (cnt % 2 ? '1' : '0'); cnt++; } cnt++; } cout << ans << endl; }