#include using namespace std; using ll = long long; string calc(int num, int bg) { string res = ""; for (int i = 0; i < num; i++) { res += (char)('0' + bg); bg = 1 - bg; } return res; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector dp(n + 1); vector dp2(n + 1, 1); for (int i = 0; i <= n; i++) dp[i] = i; dp2[0] = 0; for (int i = 2; i * i <= n; i++) { for (int j = i * i; j <= n; j++) { int cost = dp[j - i * i] + i; if (dp[j] > cost) { dp[j] = cost; dp2[j] = i; } } } vector odd; deque even; int cur = n; while (cur > 0) { if (dp2[cur] % 2 == 1) odd.push_back(dp2[cur]); else even.push_back(dp2[cur]); cur -= dp2[cur] * dp2[cur]; } sort(odd.begin(), odd.end()); sort(even.begin(), even.end()); string ans = ""; for (int x : odd) { ans += calc(x, 0); } int bg = 0; while (!even.empty()) { if (bg == 0) { ans += calc(even.back(), bg); even.pop_back(); bg = 1; } else { ans += calc(even.front(), bg); even.pop_front(); bg = 0; } } cout << ans << endl; return 0; }