#include using namespace std; using ll = long long; const ll INF = 0x1fffffffffffffff; ll priority(ll a){ return a & 1 ? a : INF - a; } int main(){ ll n; cin >> n; assert(1 <= n && n <= 100000); vector dp(n + 1, INF), min(n + 1, INF), max(n + 1, -INF); dp[0] = 0; for(ll i = 0; i < n; i++) for(ll j = 1; i + j * j <= n; j++){ if(dp[i + j * j] > dp[i] + j){ dp[i + j * j] = dp[i] + j; min[i + j * j] = j; max[i + j * j] = j; } else if(dp[i + j * j] == dp[i] + j){ if(priority(min[i + j * j]) > priority(j)) min[i + j * j] = j; if(priority(max[i + j * j]) < priority(j)) max[i + j * j] = j; } } char c = '0'; while(n){ ll cnt; if(c == '0') cnt = min[n]; else cnt = max[n]; n -= cnt * cnt; for(ll i = 0; i < cnt; i++){ cout << c; c ^= 1; } c ^= 1; } cout << endl; }