#include using namespace std; using ll = long long; using P = pair; #define rep(i, n) for(ll i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() templatebool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;} templatebool chmax(T&a, const T&b){if(a> n; if(!n){ cout << -1 << '\n'; return 0; } int b = n&1, cnt = 1; ll x = 1; vector ans; n >>= 1; while(n){ if(b != n%2){ cnt++; ans.push_back(x); } b = n%2; n >>= 1; x <<= 1; } ans.push_back(x); cout << cnt << '\n'; for(ll y:ans) cout << y << ' '; cout << '\n'; return 0; }