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