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