#include #include using ll = long long ; using namespace std; int main(){ ll K,count=0,zero,one; cin >> K; if(K==0){ cout << 1<< endl << 0 << endl; return 0; } while(K%2==0){ K/=2; if(count==0) count++; else count*=2; } if(count==0) zero = 0; else zero = log2(count); one = sqrt(K*2)+1; cout << zero+one << endl; while(zero--) cout << "0 "; while(one--) cout << "1 "; cout << endl; return 0; }