#include #define INF 1000000001 #define MOD 1000000007 #define long long long #define all(x) x.begin(),x.end() using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while(t--) { long a,b; cin >> a >> b; int mx = -1; for(int i = 59; i>=0; i--) { if((b&(1LL< (a&(1LL< res; for(int i = 0; i=0; i--) { if((b&(1LL< (a&(1LL<