You are given an integer .
Consider all unordered pairs such that 1 \le a < b \le n. For each pair, compute the value a \oplus b (bitwise XOR).
Your task is to find the number of distinct values among all these XOR results modulo 10^9 + 7.
^{*} Here, or denotes the Bitwise XOR operation.
The first line of the input will contain a single integer (1 \le t \le 10^3).
Each test case will contain a single integer (1 \le n \le 10^{18}).
Print the total number of unique XOR values.
Example 1
In the second test case, the only possible pair is , so there is only unique value and that is 1 \oplus 2 = 3.
In the third test case, possible pairs are (1, 2), (1, 3), (2, 3):
1 \oplus 2 = 3,
2 \oplus 3 = 1,
1 \oplus 3 = 2
All of them give unique values.
So the answer is .
Subtask ( points): 1 \le \sum n \le 500.
Subtask ( points): 1 \le \sum n \le 10^3.
Subtask ( points): 1 \le \sum n \le 4 \cdot 10^5.
Subtask ( points): 1 \le n \le 10^9 and no sum constraints.
Subtask ( points): No additional constraints.