#include #include #include using namespace std; int main() { int n; cin >> n; vector v; for (int i = int(sqrt(n)); i > 0; i--) { vector w; for (int j = i, m = n; m != 0;) { if (m - j * j < 0) { j--; } else { w.push_back(j); m -= j * j; } } if (i == int(sqrt(n)) || w.size() < v.size()) { v = w; } } string s = "0"; for (const int& l : v) { for (int i = 1; i < l; i++) { if (s.back() == '0') s += '1'; else s += '0'; } s += s.back(); } s.pop_back(); cout << s << endl; return 0; }