#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define rep2(i, j, n) for (int i = j; i < (int)n; i++) int main() { int T; cin >> T; rep(i, T) { int N; cin >> N; int m = 0; rep2(j, 1, N+1) { if (N % j == 0) m++; } if (m % 2 == 0) cout << "K" << endl; else cout << "P" << endl; } return 0; }