#include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0;i<(n);++i) #define REPS(i,s,t) for(int i=(s);i<(t);++i) #define INF 2000000007 #define MOD 1000000007 #define MAX 200005 typedef unsigned int uint; typedef unsigned long long int ull; typedef long long int ll; int dp[32]; int main(){ int K;cin>>K; if(K==0){ cout << "2" << endl; cout << "0 1" << endl; return 0; } int a=0,b=0; int N=K; while(K%2==0){ K/=2; a++; } REPS(i,2,31){ dp[i] = i*(i-1)/2; } REP(i,30){ REP(j,31) if(dp[j]==K){ b=j; break; } if(b > 0) break; K*=2; --a; } cout << (a+b) << endl; REP(i,a) cout << 0 << " "; REP(i,b) cout << 1 << " "; cout << endl; return 0; }