#include using namespace std; using ll = long long; int main() { ll N; cin >> N; if (N == 0) { puts("-1"); return 0; } ll ans = N ^ (N >> 1); cout << __builtin_popcountll(ans) << endl; for (int i=0; i<60; ++i) { if (ans & (1ull << i)) cout << (1ull << i) << " \n"[(ans ^= (1ull << i)) == 0]; } }