## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

## [Solution] Simple XOR CodeChef Solution | CodeChef Problem Solution 2022

You are given two integers $L$ and $R\phantom{\rule{mediummathspace}{0ex}}\left(L+3\le R\right)$. Output any four distinct integers between $L$ and $R$ (inclusive) such that their bitwise XOR is zero.

More formally, output any four integers ${a}_{1},{a}_{2},{a}_{3},{a}_{4}$ such that:

• ${a}_{1}\oplus {a}_{2}\oplus {a}_{3}\oplus {a}_{4}=0$
• $L\le {a}_{1},{a}_{2},{a}_{3},{a}_{4}\le R$
• ${a}_{i}={a}_{j}$ if and only if $i=j$

If more than one such quadruple exists, you may output any of them. If no such quadruple exists, print $-1$ instead.

### Input Format

• The first line of input will contain a single integer $T$, the number of test cases. The description of the test cases follows.

• Each test case consists of a single line of input, containing two space-separated integers $L,R$.

### Output Format

For each testcase, output any four distinct integers between $L$ and $R$ such that their bitwise XOR is zero, or output $-1$ in case no such quadruple of four distinct integers exists.

### Constraints

• $1\le T\le 1000$
• $1\le L,R\le {10}^{9}$
• $L+3\le R$, so there are at least four distinct integers in the range.