CF1421A.XORwice

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

XORwice

In order to celebrate Twice's 5th anniversary, Tzuyu and Sana decided to play a game.

Tzuyu gave Sana two integers aa and bb and a really important quest.

In order to complete the quest, Sana has to output the smallest possible value of (a⊕xa \oplus x) + (b⊕xb \oplus x) for any given xx, where ⊕\oplus denotes the bitwise XOR operation.

Input

Each test contains multiple test cases. The first line contains the number of test cases tt (1≤t≤1041 \le t \le 10^{4}). Description of the test cases follows.

The only line of each test case contains two integers aa and bb (1≤a,b≤1091 \le a, b \le 10^{9}).

Output

For each testcase, output the smallest possible value of the given expression.

Note

For the first test case Sana can choose x=4x=4 and the value will be (6⊕46 \oplus 4) + (12⊕412 \oplus 4) = 2+82 + 8 = 1010. It can be shown that this is the smallest possible value.

Samples

6
6 12
4 9
59 832
28 14
4925 2912
1 1
10
13
891
18
6237
0

在线编程 IDE

建议全屏模式获得最佳体验