#include #include #include using namespace std; int main() { long a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, ans = 0; int k; cin >> k; while (k > 10000) { k /= 2; h++; } for ( a = 1; a <= 30; a++) { if (a>1) { b = a - 1; } else { b = 1; } if (k%(a*b)==0) { c = k / (a*b); if (!(c & (c - 1))) { d = 0; while (c != 1) { d++; c /= 2; } if (a == 1) { a++; d--; } cout << d + a + 1 << endl; if (a == 2) { } for (b = 0; b <= d; b++) { cout << "0 "; } for ( b = 0; b < h; b++) { cout << "0 "; } for (b = 0; b < a; b++) { cout << "1 "; } cout << endl; return 0; } } } return 0; }