a, b = map(int, input().split()) print('P' if abs(a-b) % 2 == 0 else 'Q')