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