#include using namespace std; int main(void){ int t; cin>>t; while(t--){ long long l,r; cin>>l>>r; if(l==r&&l==0){ cout<<0<=0;i--){ if(r&(1<