#ifdef __LOCAL #define _GLIBCXX_DEBUG #endif #include using namespace std; using ll = long long; using P = pair; using PIL = pair; using PLI = pair; using PLL = pair; template bool chmin(T &a, T b) {if(a>b){a=b;return 1;}return 0;} template bool chmax(T &a, T b) {if(a void show_vec(T v) {for (int i=0;i void show_pair(T p) {cout< bool judge_digit(T bit,T i) {return (((bit&(1LL< h_idx4 = {-1, 0,0,1}; const vector w_idx4 = { 0,-1,1,0}; const vector h_idx8 = {-1,-1,-1, 0,0, 1,1,1}; const vector w_idx8 = {-1, 0, 1,-1,1,-1,0,1}; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); ll a,b; cin >> a >> b; if (a < b) swap(a,b); if (a % 2 == 1 && a == b){ cout << "Q" << endl; } else if (a % 2 == 0 && a - 1 == b){ cout << "Q" << endl; } else cout << "P" << endl; }