Given N in Gray code equivalent. Find its binary equivalent.
The first line contains an integer T, number of test cases. For each test cases, there is an integer N denoting the number in gray equivalent.
For each test case, in a new line, the output is the decimal equivalent number N of binary form.
1 <= T <= 100
0 <= n <= 108
Testcase1. 4 is represented as 100 and its binary equivalent is 111 whose decimal equivalent is 7. Testcase2. 15 is represented as 1111 and its binary equivalent is 1010 i.e. 10 in decimal.