There is a special array created by Barbarian for his beautiful Arrayland where A1 is 1 always.
Each Ai is generated as:
Ai=(A1⊕A2⊕A3..........Ai−2⊕Ai−1⊕i)(⊕isXOR) ∀i>1.
Input:
The first line contains an integer T denoting the number of test cases. Next line contains T integers N, denoting the index of the array for which you need to print the answer.
Output:
Print An corresponding to the N in a separate line for each test case.
Constraint:
T=1000001≤N≤106