#include using namespace std; int main() { int64_t k; cin >> k; [&] { for (int64_t n = 1; n <= 30; n++) { for (int64_t x = 0; x <= n; x++) { int64_t y = n - x; if ((x * x - x) * int64_t(pow(2, y)) == 2 * k) { cout << n << endl; for (int64_t i = 0; i < x; i++) { cout << 1 << ' '; } for (int64_t i = 0; i < y; i++) { cout << 0 << ' '; } cout << endl; return; } } } }(); return 0; }