Fermat's Little Theorem#3723

Fermat's Little Theorem

4 seconds
256 megabytes
Hard

Fermat's Little Theorem tells us that for any prime number and any integer , the expression a^p - a is divisible by . In this problem, we explore a similar concept.

Given a natural number n > 1, your task is to identify all natural numbers such that a^n - a is divisible by for every integer .

For example, when n = 2, there are such numbers: and . When n = 3, there are such numbers: , , , and . Since there may be many such numbers, compute the sum of all these numbers modulo 10^9 + 7.

It is guaranteed that for any n > 1, the set of such numbers is finite.

Input

The first line contains a natural number (1 \leq T \leq 10^5) — the number of test cases.

Each of the following lines contains an integer (2 \leq n \leq 2 \times 10^6).

Output

For each given in the input, output the answer on a separate line.

Examples

Example

Input
2
2
3
Output
3
12

Example 1

Loading
Loading

Note

For n = 2, the valid values of are and . The sum is 1 + 2 = 3.

For n = 3, the valid values of are , , , and . The sum is 1 + 2 + 3 + 6 = 12.