#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int num, i, j;
while(scanf("%d", &num) != EOF){
if (num >= 2 && num <= 2147483647){
j = 1;
for (i = 2;i <= sqrt(num) -1; i++){
if (num % i == 0) {
j = 0;
break;
}
}
if (j == 0) printf("非質數\n");
else printf("質數\n");
}
}
return 0;
}