a, b = [int(v) for v in input().split()] if min(a, b) % 2 == 0: print("P") else: print("Q")