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