开long long!!!!
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main()
{
int n;
cin >> n;
while (n--)
{
int x;
cin >> x;
int aw = x;
for (int i = 2; i <= x / i; i++)
{
if (x % i == 0)
{
aw = aw * (i - 1) / i;
while (x % i == 0)x /= i;
}
}
if (x - 1)aw = aw * (x - 1) / x;
cout << aw << endl;
}
return 0;
}