def solve(N): if N ^ 2 == 3: return 'P' else: return 'K' T = int(input()) for _ in range(T): N = int(input()) print(solve(N))