E. Exponent
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output

The exponent of a group is the least common multiple of the orders of all elements in the group, but this has nothing to do with this problem. It's just to make the title start with E.

Little Ma gives you a positive integer $$$n$$$.

For each integer $$$a$$$ with $$$1 \le a \le n$$$, define $$$\operatorname{ord}_n(a)$$$ as the smallest positive integer $$$x$$$ satisfying:

$$$$$$ a^x \equiv 1 \pmod n $$$$$$

If no such positive integer $$$x$$$ exists, define $$$\operatorname{ord}_n(a)=0$$$.

Compute:

$$$$$$ \sum_{a=1}^{n}\operatorname{ord}_n(a) $$$$$$

Regarding $$$\equiv$$$: $$$\equiv$$$ is the congruence symbol in number theory. For three integers $$$a, b, p$$$, the mathematical expression $$$a \equiv b \pmod p$$$ is equivalent to the existence of an integer $$$k$$$ satisfying $$$a - b = kp$$$.

Input

The first line contains an integer $$$T$$$ $$$(1\leq T\leq 10^3)$$$, the number of test cases.

Each of the next $$$T$$$ lines contains one positive integer $$$n$$$ $$$(1\leq n\leq 10^9)$$$.

Output

For each test case, output one integer in a single line: the required sum.

Examples
Input
5
1
5
8
54
9653618
Output
1
11
7
183
9856882167209
Input
5
48
2
4
8
16
Output
47
1
3
7
23