#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; ll calc(ll zero, ll one){ if(one <= 1) return 0; ll p = 1; rep(i,zero) p <<= 1; return one*(one-1)/2LL * p; } int main(){ ll K; cin >> K; REP(N,1,31){ rep(zero,N+1){ int one = N-zero; if(calc(zero, one) == K){ vector ret; rep(i,zero) ret.push_back(0); rep(i,one) ret.push_back(1); cout << ret.size() << endl; rep(i,ret.size()){ if(i>0) cout << " "; cout << ret[i]; } cout << endl; return 0; } } } return 0; }