#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--;) { long long n; cin >> n; if (n == 2) { cout << "P\n"; } else if (n % 6 == 0 && n / 6 % 2 == 1) { cout << "P\n"; } else { cout << "K\n"; } } }