## https://yukicoder.me/problems/no/955 def main(): a, b = map(int, input().split()) if abs(a - b) == 1: print("Q") else: print("P") if __name__ == '__main__': main()