#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { int t; cin >> t; while (t--) { int n; cin >> n; vector div(0); for (int i = 1; i * i <= n; i++) { if (n % i == 0) { div.push_back(i); if (i * i != n) div.push_back(n / i); } } cout << "KP"[div.size() % 2] << endl; } return 0; }