#include using namespace std; using ll = long long; #ifdef tabr #include "library/debug.cpp" #else #define debug(...) #endif bool is_prime(unsigned long long n) { if (n <= 1) { return false; } for (long long i = 2; i * i <= n; i++) { if (n % i == 0) { return false; } } return true; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; for (int i = 0; i < n; i++) { ll x; cin >> x; cout << x << " "; int j = 0; if (is_prime(x)) { j = 1; } cout << j << '\n'; } return 0; }