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