Task
Mr. X enjoys solving and especially talking a lot about bitwise operations, even at the New Year's Day party. While drinking with his friends, he came up with the following challenge.
There are queries, and in each query you are given a positive integer (). You are required to answer the following question:
What is the bitwise XOR of the integers in the interval [] and what is the maximum bitwise XOR we can get by removing exactly one integer from that interval?
Your task is to solve the challenge of Mr. X.
Input
The first line of the input contains , the number of queries ().
Each of the next lines contains a positive integer , describing a query ().
For tests worth points:
For tests worth points:
For tests worth points: and
Output
You need to write lines, the answers to each query. Every line should contain two numbers, namely, the bitwise XOR of the integers in the interval [], and the maximum bitwise XOR we can get by removing one integer from the interval.
stdin
5
29
14
9
12
31
stdout
1 29
15 15
1 9
12 15
0 31