#include #include using namespace std; using namespace atcoder; //const long long INF = 1LL<<60; int main() { int t; cin >> t; for (int i=0; i < t; i++){ int n; cin >> n; int cnt = 0; for (int i=1; i < n; i++){ if (n % i == 0) cnt++; } if (cnt % 2) cout << "K" << endl; else cout << "P" << endl; } return 0; }