T=int(input()) for i in range(T): A,B=map(int,input().split()) P=[] for i in range(60): if A+(1<B: break if A&(1<