纯互质因子
#include
int zi(int x)
{int rex&#61;x;for(int i&#61;2;i*i<&#61;x;i&#43;&#43;){if(x%i&#61;&#61;0)rex&#61;rex/i*(i-1);while(x%i&#61;&#61;0)x&#61;x/i;}if(x>1)rex&#61;rex/x*(x-1);return rex;
}
int main()
{int t,n;scanf("%d",&t);while(t--){scanf("%d",&n);printf("%d\n",zi(n));}
}