T = int(input()) for _ in range(T) : N = int(input()) ans = 1 for i in range(1, N + 1) : if N % i == 0 : ans = ans ^ 1 print("K" if ans else "P")