a, b = map(int, input().split()) if a == b: print("Q") else: diff = abs(a - b) if diff % 2 == 0: print("P") else: print("Q")