#include #include #include using namespace std; vector f(int x) { vector ret; for (int i = 1; i * i <= x; i++) { if (x % i == 0) { ret.push_back(i); if (x / i != i) ret.push_back(x / i); } } return ret; } int main() { int T; cin >> T; while (T--) { int N; cin >> N; vector fac = f(N); cout << (fac.size() % 2 == 0? 'K' : 'P') << endl; } return 0; }