Xorray

3

2 votes
Easy
Problem

There is a special array created by Barbarian for his beautiful Arrayland where A1 is 1 always.

Each Ai is generated as:

Ai=(A1A2A3..........Ai2Ai1i)(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=1000001N106

 

Time Limit: 2
Memory Limit: 256
Source Limit:
Editor Image

?