#include using namespace std; //#include //using namespace atcoder; using ll = long long int; using ull = unsigned long long int; using ld = long double; constexpr ll MAX = 2000000000000000000; constexpr ld PI = 3.14159265358979; constexpr ll MOD = 998244353;//2024948111; ld dotorad(ld K){return PI * K / 180.0;} ld radtodo(ld K){return K * 180.0 / PI;} mt19937 mt; void randinit(){srand((unsigned)time(NULL));mt = mt19937(rand());} int main(){ ll N; cin >> N; if(N == 0){ cout << -1 << endl; return 0; } vector ans; ll p = N; for(ll i = 42;i > 0;i--){ if(p & (1 << i)){ p ^= (1 << (i + 1)) - 1; ans.emplace_back((1 << (i))); } } cout << (ll)ans.size() << endl; for(ll i = 0;i < (ll)ans.size();i++) cout << ans[i] << " \n"[i == (ll)ans.size() - 1]; }