#include using namespace std; void solve() { int n; cin >> n; int cnt = 0; for(int i = 1; i <= n; i++) { cnt += (n%i == 0); } cout << (cnt%2 == 0 ? 'K' : 'P') << endl; } int main() { int t; cin >> t; while(t--) { solve(); } }