/* -*- coding: utf-8 -*- * * 2721.cc: No.2721 "Don't say N" Game - yukicoder */ #include #include #include using namespace std; /* main */ int main() { int tn; scanf("%d", &tn); while (tn--) { int n; scanf("%d", &n); if (n == 1) puts("P"); else { int r = sqrt(n + 0.5); if (r * r == n) puts("P"); else puts("K"); } } return 0; }