a, b = map(int, input().split()) print("P" if abs(a - b) > 1 else "Q")