#include<iostream>
#include<math.h>
using namespace std;
int main(){
float a = 0; //input
int x = 0; //用來做判斷
int b = 0; //a開根號後轉換成整數
int c = 0; //a轉換成整數
while(cin >> a){
if(a == 1){
cout << "非質數" << endl;
}
else if(a == 2){
cout << "質數" << endl;
}
else{
b = static_cast<int>(sqrt(a)); //a開根號後轉換成整數
c = static_cast<int>(a); //a轉換成整數
for(int i = 2 ; i <= b ; i++){
if(c%i == 0){
x = 1;
break;
}
}
if(x == 1){
cout << "非質數" << endl;
x = 0;
}
else if(x == 0){
cout << "質數" << endl;
x = 0;
}
}
}
system("pause");
return 0;
}