#include using namespace std; using ll = long long; #ifdef LOCAL #include #else #define debug(...) #endif int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); int T; cin >> T; constexpr int M = 1000; vector cnt(M + 1); for (int i = 1; i <= M; i++) { for (int j = i; j <= M; j += i) { cnt[j]++; } } while (T--) { int N; cin >> N; cout << (cnt[N] & 1 ? 'P' : 'K') << '\n'; } }