import sys input = sys.stdin.readline query = [int(input()) for _ in [0] * int(input())] for n in query: if(n == 1): print('P') else: print('K')