Kim#12931

Kim

1 second
256 megabytes
Hard

Kim Wexler is tired of working for Mesa Verde. Instead, she wants to solve the following problem.

Kim has two integers and . Help her to find any such that 0 \leq x \leq 10^9 and the value of (a+x)\texttt{ AND }(b+x) is minimized.

Here AND denotes the bitwise AND operation.

Input

The first line contains a single integer (1 \leq t \leq 2\cdot10^5) — the number of test cases. The description of test cases follows.

The only line of each test case contains two integers and (1\leq a, b \leq 10^9).

Output

For each test case, output a single integer — the answer to the problem. If there are several integers such that 0 \leq x \leq 10^9 and the value of (a+x)\texttt{ AND }(b+x) is minimized, you can output any of them.

Examples

Example

Loading
Loading

Note

In the first test case, Kim can select x = 1 to get (1+1)\texttt{ AND }(11+1) = 2\texttt{ AND }12 = 0.

In the second test case, Kim can select x = 0 to get (64+0)\texttt{ AND }(64+0) = 64\texttt{ AND }64 = 64.