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