import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines t,*ab = map(int, read().split()) def calc(a,b): res = [] r_bit = 0 if(a^b < a): length = 0 for i in range(60): if (1< b: length = i break for i in range(length-1,0,-1): if(a&b) >> i : a -= (1< a): if(a & (1 << r_bit)): res.append(1 << r_bit) a += (1 << r_bit) else: r_bit += 1 res2 = [] for i in range(60): if(b^(1<>i)&1 : res2.append(1<