A, B = map(int, input().split()) a = min(A, B) b = max(A, B) if a == b: print('Q') else: print('P')