Question
The Puzzle
In Haripur, two friends named Arjun and Ravi stumbled upon a puzzle while exploring an antique shop. The puzzle presented a challenge: given two numbers L and R, they need to determine whether there exist four distinct integers between L and R (inclusive) whose combined bitwise XOR equals zero.
If such integers exists, they need to provide them; otherwise, they must respond with -1. Time was ticking as the antique shop’s secret door began to close. Can you help them quickly solve this puzzle to escape the shop and uncover its secrets before it’s too late?
Input
The first line of the input contains a single integer T, denoting the number of test cases.
The first and only line of each test case contains two space-separated integers L and R.
Constraints
1 ≤ T ≤ 1000
1 ≤ L < R ≤ 109
L + 3 ≤ R so there are at least four distinct integers in the range.
The first and only line of each test case contains two space-separated integers L and R.
Constraints
1 ≤ T ≤ 1000
1 ≤ L < R ≤ 109
L + 3 ≤ R so there are at least four distinct integers in the range.
Output
For each testcase, output any four distinct integers between L and R (both inclusive) such that their bitwise XOR is zero, or output −1 in case no such quadruple exists.
Example
Sample Input
2
1 4
3 30
Sample Output
-1
6 12 18 24
Explanation
In first testcase there are only 4 numbers 1, 2, 3, 4 and xor of these is not 0 so -1.
In the second testcase the xor of 6, 12, 18, 24 is 0. There can be many other possible answers you can return any.
2
1 4
3 30
Sample Output
-1
6 12 18 24
Explanation
In first testcase there are only 4 numbers 1, 2, 3, 4 and xor of these is not 0 so -1.
In the second testcase the xor of 6, 12, 18, 24 is 0. There can be many other possible answers you can return any.