Vitaliy is well known as a pyrotechnician at his school. More than once, due to his experiments, windows had to be replaced, doors reinstalled, and computers repaired. Now, finally, graduation is near, and Vitaliy has the opportunity to show his full talent by preparing the most spectacular fireworks display in the school's history. To accomplish this, he needs exactly substances. However, it's not that simple: for the fireworks to be beautiful and powerful, the explosion force needs to be maximized.
The explosion force is calculated by the formula:
where and are the quantities of the first and second substances, respectively, and denotes the bitwise exclusive OR (XOR) operation (also known as addition modulo ). Vitaliy is experimenting with the quantities, and your task is to determine the explosion force for each of his experiments.
The first line contains a single integer (1 \leq t \leq 50000) — the number of experiments. Each of the following lines contains two integers, a_i and b_i, representing the quantities of the two substances (0 \leq a_i \leq b_i \leq 2^{31} - 1).
For each experiment, output the explosion force on a separate line.
Example 1