#include constexpr int N = 30; void solve() { int k; std::cin >> k; if (k == 0) { std::cout << 1 << std::endl << 0 << std::endl; return; } for (int o = 2; o <= N; ++o) { int p = o * (o - 1) / 2; if (k % p != 0) continue; int z = 0; while ((1LL << z) < k / p) ++z; if ((1LL << z) != k / p || o + z > N) continue; std::cout << o + z << std::endl; for (int i = 0; i < o; ++i) { std::cout << 1 << " "; } for (int i = 0; i < z; ++i) { std::cout << 0 << " "; } std::cout << std::endl; return; } std::terminate(); } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }