#include //#include using namespace std; //using namespace atcoder; using ll = long long; //using mint = modint998244353; using cll = __int128_t; cll mod_exp(cll b, cll e, cll m){ if (e > 0 && b == 0) return 0; cll ans = 1 % m; b %= m; while (e > 0){ if (e & 1) ans = (ans * b) % m; e >>= 1; b = (b*b) % m; } return ans; } bool _miller_rabin(ll N, vector A){ ll s = 0, t = N-1; while(!(t & 1)){ s++; t >>= 1; } for (auto a : A){ if (N <= a) return 1; ll x = mod_exp(a, t, N); if (x == 1) continue; bool f=0; for (int r=0; r> N; while(N--){ cin >> x; cout << x << " " << miller_rabin(x) << endl; } return 0; }