#include #define rep(a,n) for (ll a = 0; a < (n); ++a) using namespace std; //using namespace atcoder; using ll = long long; typedef pair P; typedef pair PP; typedef vector > Graph; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const ll INF = 1e18; #define debug(v) cout<<#v<<": ",prt(v); template inline void prt(pair p){cout<<"("< inline void prt(tuple p){cout<<"("<(p)<<", "<(p)<<", "<(p)<<")\n";} inline void prt(bool p){if(p)cout<<"True"<<'\n';else cout<<"False"<<'\n';} template inline void prt(vector v){cout<<'{';for(ll i=0;i inline void prt(vector >& vv){ for(const auto& v : vv){ prt(v); } } template inline void prt(deque v){cout<<'{';for(ll i=0;i inline void prt(map v){cout<<'{';ll c=0;for(auto &p: v){cout< inline void prt(unordered_map v){cout<<'{';ll c=0;for(auto &p: v){cout< inline void prt(set v){cout<<'{';for(auto i=v.begin();i!=v.end();i++){cout<<*i;if(i!=--v.end())cout<<", ";}cout<<'}'<<'\n';} template inline void prt(multiset v){cout<<'{';for(auto i=v.begin();i!=v.end();i++){cout<<*i;if(i!=--v.end())cout<<", ";}cout<<'}'<<'\n';} void solve(ll a,ll b){ int high_order_bit = 0; for(int i=63;i>=0;i--){ if((!((a>>i)&1))&&((b>>i)&1)){ high_order_bit = i; break; } } vectorans; ll now = 1; for(int i=0;i>i)&1){ ans.push_back(now); a += now; } now *= 2; } now /= 2; for(int i=high_order_bit-1;i>=0;i--){ if((b>>i)&1){ ans.push_back(now); } now /= 2; } ll sz = ans.size(); cout << sz << endl; rep(i,sz-1){ cout << ans[i] << ' '; } cout << ans[sz-1] << endl; return; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); //input ll t; cin >> t; rep(test,t){ ll a,b; cin >> a >> b; solve(a,b); } return 0; }