Ensure that you are logged in and have the required permissions to access the test.
Walpurgisnacht has arrived and its wrecking havoc on city. Madoka must save the day somehow and has to comeup with a solution to the following problem.
The power of Walpurgisnacht is varying and lies in the range of L to R. Madoka has a special weapon that she can set to a special power levels. She selects two magic levels in Walpurgis's range and activates the weapon with it. The final power with which the weapon fires is the XOR value of input magic level.
Given two integers L, R. Select any two numbers lying between these two such that their XOR value is maximum.
Formally, find two integers x, y such that L ≤ x,y ≤ R and x ^ y is maximum.
Input:
First line contains T, number of test cases.
Each of the next T lines contain two space separated integers L R.
Output:
Print the result (xor value) for each case on a newline.
Contraints:
1 ≤ T ≤ 100
1 ≤ L ≤ R ≤ 1018