#include using i64 = long long; int main() { int n; std::cin >> n; std::vector> t(n + 1); std::vector s(n + 1, 1000000); for (int i = 1; i * i <= n; i++) { t[i * i].push_back(i); s[i * i] = i; } for (int i = 1; i <= 4; i++) { for (int j = 1; j <= n; j++) { if (t[j].size() == i) { for (int k = 1; j + k * k <= n; k++) { int index = j + k * k; if (!t[index].empty() && t[index].size() <= i) continue; if (s[j] + k >= s[index]) continue; t[index] = t[j]; t[index].push_back(k); s[index] = s[j] + k; } } } } std::sort(t[n].begin(), t[n].end(), [](int lhs, int rhs) { bool lo = lhs & 1, ro = rhs & 1; if (lo && !ro) return true; if (!lo && ro) return false; if (lo) return lhs < rhs; return lhs > rhs; }); int base = 0; for (auto e : t[n]) { for (int i = 0; i < e; i++) std::cout << ((i + base) % 2 ? '1' : '0'); base = !(e & 1); } std::cout << std::endl; return 0; }