a,b=map(int,input().split()) if a%2==b%2: print("P") else: print("Q")