import java.util.Scanner;
public class Main {
public static void main
(String [] args
){ Scanner sc
= new Scanner
(System.
in); int n = sc.nextInt();
for (int i = 1; i <= n; i++) {
int v = sc.nextInt();
int contador = 0;
for (int j = 1; j <= v; j++) {
if (v % j == 0){
contador++;
if (contador == 3) {
break;
}
}
}
if (contador == 2) {
} else {
System.
out.
println("NOT PRIME"); }
}
}
}
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwpwdWJsaWMgY2xhc3MgTWFpbiB7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmcgW10gYXJncyl7CiAgICAgICAgU2Nhbm5lciBzYyA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CiAgICAgICAgaW50IG4gPSBzYy5uZXh0SW50KCk7CiAKICAgICAgICBmb3IgKGludCBpID0gMTsgaSA8PSBuOyBpKyspIHsKICAgICAgICAgICAgaW50IHYgPSBzYy5uZXh0SW50KCk7CiAgICAJICAgIGludCBjb250YWRvciA9IDA7CgogICAgICAgICAgICBmb3IgKGludCBqID0gMTsgaiA8PSB2OyBqKyspIHsKICAgICAgICAgICAgICAgIGlmICh2ICUgaiA9PSAwKXsKICAgICAgICAgICAgICAgICAgICBjb250YWRvcisrOwogICAgICAgICAgICAgICAgICAgIGlmIChjb250YWRvciA9PSAzKSB7CiAgICAgICAgICAgICAgICAgICAgCWJyZWFrOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY29udGFkb3IgPT0gMikgewogICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJQUklNRSIpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJOT1QgUFJJTUUiKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KfQ==