#include using std::cout; using std::endl; using std::cin; int main(){ int n; cin >> n; if(n == 0){ cout << 1 << endl; return 0; } int a = 0, x = n; while(x % 2 == 0){ x /= 2; a++; } if(x == 1){ cout << a + 2 << endl; for(int i = 0; i < a; i++) cout << 0 << " "; cout << 1 << " " << 1 << endl; return 0; } for(int i = 2; i * i <= n; i++){ if(n % i or n % (i + 1)) continue; int B = i + 1; int pos = n / ((i * (i + 1)) / 2); int A = 0; while(pos % 2 == 0){ pos /= 2; A++; } if(pos != 1) continue; cout << A + B << endl; for(int i = 0; i < A; i++) cout << 0 << " "; for(int i = 0; i < B; i++) cout << 1 << " "; cout << endl; break; } return 0; }