for _ in range(int(input())): print("P" if int(input()) == 1 else "K")