a,b=map(int,input().split()) if min(a,b)%2: print('Q') else: print('P')