#include bool IsPrime(unsigned long long x) noexcept { if(x <= 1) return false; if(x % 2 == 0) return x == 2; using u64 = unsigned long long; using u128 = __uint128_t; u64 d = x-1; int s = 0; int q = 63; while(!(d&1)){ d >>= 1; s++; } while(!(d >> q)) q--; u64 r = x; for(int t=0; t<5; t++) r*=2-r*x; u64 n2 = -(u128)x % x; auto red = [=](u128 t) noexcept -> u64 { t = (t + (u128)((u64)t*-r)*x) >> 64; return (t >= x) ? t-x : t; }; u64 one = red(n2); for(u64 base : { 2, 325, 9375, 28178, 450775, 9780504, 1795265022 }){ if(base%x==0) continue; u64 a = base = red((u128)(base%x)*n2); for(int e=q-1; e>=0; e--){ a = red((u128)a*a); if((d>>e)&1) a = red((u128)a*base); } if(a == one) continue; for(int t=1; t int main(){ int T; scanf("%d", &T); for(int i=0; i