for t in range(int(input())): print('P' if input()=='1' else 'K')