#include using namespace std; using ll = long long; using ld = long double; #ifdef LOCAL #include #else #define debug(...) void(0) #endif int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; const int N = 1000; vector cnt(N + 1, 0); for(int i = 1; i <= N; i++) { for(int j = i; j <= N; j+=i) { cnt[j]++; } } debug(cnt); while(T--) { int n; cin >> n; if(cnt[n] % 2) { cout << "P" << endl; }else { cout << "K" << endl; } } }