#include #include using namespace std; int main() { int K, i, j; cin >> K; for (i = 1; i <= 30; ++i) { for (j = 0; j <= 30 - i; ++j) { if ((i - 1) * i / 2 * (int)pow(2, j) == K) break; } if (j != 31 - i) break; } cout << i + j << endl; for (int k = 0; k < i; ++k) cout << "1 "; for (int l = 0; l < j; ++l) cout << "0 "; }