#include #define REP(i, start, end) for (int i=start, i##Len=(end); i < i##Len; ++i) using ll = int64_t; using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); int N; cin >> N; static int dp[300010] = {}; static int from[300010] = {}; dp[N] = 1; while (dp[0] == 0) { REP(i, 0, N+1) if (dp[i] > 0) { ll base = 1; while (base*base <= i) { dp[i-base*base] = dp[i]+1; from[i-base*base] = base; ++base; } } } vector result; int i = 0; while (i < N) { result.push_back(from[i]); i += from[i]*from[i]; } string answer = ""; sort(result.begin(), result.end()); for (auto x: result) { if (x % 2 == 0) continue; answer += "0"; REP(i, 0, (x-1)/2) answer += "10"; } int first_zero = 1; for (int i=result.size()-1; i >= 0; --i) { if (result[i] % 2) continue; if (first_zero) { REP(j, 0, result[i]/2) answer += "01"; } else { REP(j, 0, result[i]/2) answer += "10"; } first_zero ^= 1; } cout << answer << endl; return 0; }