#include<iostream>
#include<cmath>
using namespace std;
int main(){
int a,b;
while(cin>>a){
if(a==1){
cout<<"非質數"<<endl;}
else if(a==2){
cout<<"質數"<<endl;}
else{
for(b=2;b<=sqrt(a);b++)
{
if(a%b==0){
cout<<"非質數"<<endl;
break;}
}
}
}
return 0;
}