#include using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; set s; for (int i = 1; i <= n; i++) { if (n % i == 0) { s.insert(i); } } cout << ((int)s.size() % 2 == 0 ? "K" : "P") << endl; } }