A, B = map(int, input().split()) if A < B: A, B = B, A if A - B >= 2: print("P") elif A % 2: print("P") else: print("Q")