Bob has just learned bit manipulation and is very excited about it. He goes to his friend Alice to show off his skills who is new to programming, and thus Bob challenges Alice to solve the following problem. Given two positive integers L and R, find L ^ (L+1) ^ (L+2) ^ ....... ^ (R-1) ^ R.
Alice needs to answer k such queries. Since Alice is new to programming, she seeks your help.
NOTE: Here a^b represents XOR of 2 numbers a and b.
Input Format : The first line contains a number k, the number of queries. Each of the next k lines, contain two positive integers L and R.
Output Format: For each query, output a single line, the required answer.
Constraints:
1 <= k <= 10^5
1 <= L <= R <= 10^9
For the first query, 2^3 = 1
For the second query, 3^4^5 = 2