#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); // f(2^n) ^ f(2^{n-1}) = 2^n ll N; cin >> N; if(N == 0){ cout << -1 << endl; return 0; } vector ans; ll target = N ^ (N >> 1); rep(i,40) if(target & (1LL << i)) ans.push_back(1LL << i); cout << ans.size() << endl; for(ll a : ans) cout << a << " "; cout << endl; }