#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) #define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++) #define ALL(x) (x).begin(), (x).end() const double PI = acos(-1); int main() { ios_base::sync_with_stdio(0); cin.tie(0); int k; cin >> k; for (int n = 1; n <= 30; n++) { for (int x = 1; x <= n; x++) { long long z = 1; REP (i, n-x) z *= 2; z *= x * (x-1) / 2; if (z == k) { cout << n << endl; REP (i, n) cout << (i < x ? 1 : 0) << " "; cout << endl; return 0; } } } return 0; }