#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; for (int i = 0; i < t; i++){ int n; cin >> n; int count = 0; for (int j = 1; j <= n; j++){ if (n%j == 0) count++; } cout << (count%2 ? "P" : "K") << endl; } return 0; }