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