#include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using ull = unsigned long long; int main(){ int t; cin >> t; while(t--){ ll a , b; cin >> a >> b; vector ans; int bit = 1; while((1LL << bit) <= b){ if((a & (1LL << bit)) != 0 && (b & (1LL << bit)) == 0){ a += (1LL << bit); ans.push_back(1LL << bit); } bit++; } while(bit >= 0){ if((a & (1LL << bit)) == 0 && (b & (1LL << bit)) != 0){ a += (1LL << bit); ans.push_back(1LL << bit); } bit--; } cout << ans.size() << endl; for(int i = 0; i < ans.size(); i++){ cout << ans[i] << " "; } cout << endl; //cout << a << endl; } return 0; }