#include #include using namespace std; using namespace atcoder; using ll = long long; using ull = unsigned long long; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const vector dx = {0,0,1,-1}; const vector dy = {1,-1,0,0}; const ll INF = 1e18; const ll inf = 1e8; const ll MOD = 998244353; int main(){ int t; cin >> t; for(int i = 0; i < t; i++){ int x; cin >> x; int cnt = 0; for(int j = 1; j <= x; j++){ if(x%j==0) cnt++; } if(cnt % 2 == 0) cout << 'K' << endl; else cout << 'P' << endl; } }