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