#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); int t; cin >> t; for (; t--;) { int n; cin >> n; int cnt = 0; for (int i = 1; i <= n; i++) { if (n % i == 0) { cnt++; } } cout << (cnt % 2 ? "P\n" : "K\n"); } }