Kaosar and Count ORz#12436

Kaosar and Count ORz

1 second
256 megabytes
Easy

you are given an integer , You have to determine how many pair of integers (1 \le x,y \le n) such that are x \ | \ y=n where is bitwise OR operation , print the answer modulo 10^9+7.

Input

The first line of each test case contains single integer (1 \le t \le 10^4) — the number of test cases.

The only line of each test case contains single integer (1 \le n \le 10^9) — the integer of the problem.

Output

For each test case , single integer — the answer to the problem.

Examples

Example 1

Loading
Loading

Note

In the second test case , all such pairs are (2,4),(2,6),(4,2),(4,6)(6,2),(6,4)(6,6).

Scoring

  1. Subtask ( points) : (1 \le \sum n \le 1000)

  2. Subtask ( points) : (1 \le \sum n \le 10^6)

  3. Subtask ( points) : No additional constraints