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