A,B=map(int,input().split()) if (A+B)%2==0: print("P") else: print("Q")