#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(int i=0;i div(int n){ vector d; for(int i=1;i*i<=n;i++){ if(n%i==0){ d.push_back(i); if(i!=n/i) d.push_back(n/i); } } return d; } int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); int i,j,k; int T; cin >> T; while(T--){ int N; cin >> N; vector v=div(N); int n=v.size(); if(n%2==0) cout << "K" << endl; else cout << "P" << endl; } return 0; }