def solve(): n = int(input()) return n != 1 for _ in range(int(input())): if solve(): print("K") else: print("P")