#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main(){ int a, b; cin >> a >> b; if (a > b) swap(a, b); if (a % 2 == 1 && b % 2 == 1 && a == b) cout << "Q" << endl; else if (a % 2 == 1 && b-a == 1) cout << "Q" << endl; else cout << "P" << endl; return 0; }