#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int T; cin >> T;
    while(T--){
        long long N; cin >> N;
        if(N == 1){cout << "P" << endl; continue;}
        cout << "K" << endl;
    }
}