#include using namespace std; #define rep(i, a, n) for(int i = a; i < n; i++) #define rrep(i, a, n) for(int i = a; i >= n; i--) #define inr(l, x, r) (l <= x && x < r) #define ll long long #define ld long double #define pii pair #define pll pair // constexpr ll MOD = 1000000007; constexpr ll MOD = 998244353; constexpr int IINF = 1001001001; constexpr ll INF = 9e18; template void chmax(t&a,u b){if(a void chmin(t&a,u b){if(b 0){ if(b%2 == 1) res = res*a%m; a = a*a%m; b /= 2; } return res; } int main(){ int t; cin >> t; while(t--){ ll n; cin >> n; if(n == 2){ cout << "P" << endl; }else if(n%2){ cout << "K" << endl; }else if(n%3){ cout << "K" << endl; }else if(n%4){ cout << "P" << endl; }else if(n%5){ cout << "K" << endl; }else{ cout << "K" << endl; } } return 0; }