#include using namespace std; using ll = long long; #define rep(i, n) for(int i = 0; i < n; i++) int main() { int T; cin >> T; rep(i, T) { int N; cin >> N; int c = 0; for(int j = 1; j * j <= N; j++) { if(N % j == 0) { c++; if(N / j != j) c++; } } string s = "K"; if(c % 2) s = "P"; cout << s << endl; } }