a, b = map(int, input().split()) print("Q" if (a ^ b) & 1 else "P")