#include using namespace std; int main() { long int A,B; cin >> A >> B; A=min(A,B); B=max(A,B); if (A%2==0) { cout << "P" << endl; } else { if (B>=A+2) { cout << "P" << endl; } else { cout << "Q" << endl; } } }