#include using namespace std; #ifdef _RUTHEN #include "debug.hpp" #else #define show(...) true #endif using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) template using V = vector; #include using namespace atcoder; using mint = modint998244353; int main() { ios::sync_with_stdio(false); cin.tie(0); ll N; cin >> N; if (N == 0) { cout << -1 << '\n'; return 0; } V A; for (int i = 60; i >= 0; i--) { if (N >> i & 1) { show(i); A.push_back(1LL << i); N ^= ((1LL << (i + 1)) - 1); } show(N); } cout << A.size() << '\n'; rep(i, A.size()) cout << A[i] << (i == A.size() - 1 ? '\n' : ' '); show(A); return 0; }