#include using namespace std; typedef long long ll; vector zero_one(ll k){ ll zero = 1; for(int i = 0; i <= 30; i++){ for(int j = 2; i + j <= 30; j++){ ll tmp = j * (j - 1) / 2; if(tmp * zero == k){ vector ret(2); ret.at(0) = i; ret.at(1) = j; return ret; } } zero *= 2; } } int main(void){ ll k; cin >> k; if(k == 0){ cout << 0; return 0; } auto ans = zero_one(k); cout << ans.at(0) + ans.at(1) << endl; for(int i = 0; i < ans.at(0); i++) cout << 0 << " "; for(int i = 0; i < ans.at(1); i++) cout << 1 << " "; cout << endl; return 0; }