#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); int K; cin >> K; // c1 + c0 = N // c1 * (c1 - 1) / 2 * 2^{c0} = K for(int c1 = 0; c1 <= 30; c1++) { for(int c0 = 0; c0 <= 30; c0++) { int N = c1 + c0; if(1 <= N && N <= 30 && 1LL * c1 * (c1 - 1) / 2 * (1LL << c0) == K) { cout << N << endl; rep(_,c1) cout << "1 "; rep(_,c0) cout << "0 "; cout << endl; return 0; } } } }