def main(): A, B = map(int, input().split()) A, B = min(A, B), max(A, B) if A % 2 == 0: return True if B == A or B == A + 1: return False return True if main(): print("P") else: print("Q")