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