a, b = map(int, input().split()) if a > b: a, b = b, a ans = 'PQ'[b - a <= 1 and a % 2] print(ans)