#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
while (n -- ){
int x;
bool is_prime=true;
cin>>x;
if(x==1) cout<<x<<" is not prime"<<endl;
else{
int i;
for(i=2;i<=x/i;i++)
{
if(x%i==0)
{
is_prime=false;
break;
}
else is_prime=true;
}
if(is_prime) cout<<x<<" is prime"<<endl;
else cout<<x<<" is not prime"<<endl;
}
}
return 0;
}