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