#include #define rep(i, l, r) for (int i = (l); i < (r); i++) using namespace std; typedef long long ll; int main() { int A, B; cin >> A >> B; if (A > B) swap(A, B); if ((A % 2 == 1 && B == A + 1) || (A % 2 == 1 && B % 2 == 1)) { cout << "Q" << endl; } else { cout << "P" << endl; } }