#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
int n,x;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>x;
bool flag=true;
for(int j=2;j*j<=x;j++)
{
if(x%j==0)
{
flag=false;
break;
}
}
if(flag==true) printf("%d is prime\n",x);
else printf("%d is not prime\n",x);
}
}