C. Bitwise Characteristic of a Number
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

We define the bitwise characteristic of a positive integer $$$n$$$ as the number of pairs of integers $$$i$$$ and $$$j$$$ ($$$1 \le i \lt j$$$) such that $$$i \oplus j = n$$$ and $$$i \mid j = n$$$.

Calculate the value of the bitwise characteristic of the given integer $$$n$$$.

$$$\oplus$$$ denotes the bitwise XOR operation.

$$$\mid$$$ denotes the bitwise OR operation.

Input

Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the integer for which the bitwise characteristic needs to be determined.

Output

For each test case, output a single integer — the value of the bitwise characteristic of the integer $$$n$$$.

Example
Input
3
6
8
42
Output
1
0
3
Note

In the first test case, there is only one suitable pair: $$$(2, 4)$$$.

In the second test case, there are no suitable pairs.

In the third test case, the following suitable pairs exist: $$$(2, 40)$$$, $$$(8, 34)$$$, and $$$(10, 32)$$$.