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