T = int(input()) for _ in range(T): N = int(input()) ans = 'K' if N == 1: ans = 'P' print(ans)