a, b = sorted([int(a) for a in input().split()]) if a % 2 and (b < a + 2): print("Q") else: print("P")