#include typedef long long ll; using namespace std; int INF = 1LL << 30; int MOD = 1e9+7; main(){ int K; cin >> K; int dp[33][3] = {}; dp[0][0] = 1; int N = 1,zero = 1; for(int i = 1;i <= 32;i++){ for(int j = 0;j < 3;j++){ dp[i][j] = dp[i-1][j]; if(j != 0)dp[i][j] += dp[i-1][j-1]; /* dp[i][j] += dp[i-1][j]; if(j != 2)dp[i][j+1] += dp[i-1][j]; */ } //cout << dp[i][2] << endl; if(!dp[i][2] || K % dp[i][2] != 0)continue; int num = K / dp[i][2]; //2^Nで表せるとき if((num & -num) == num){ zero = log2(num); N = log2(num) + i; break; } } //cout << N << " " << zero << endl; cout << N << endl; for(int i = 0;i < N;i++){ if(zero){ cout << 0 << endl; zero--; }else{ cout << 1 << endl; } } }