#include #include #include #include #include #include #include #include #include #include #include #include #define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl; #define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using namespace std; typedef long long ll; bool win[100][100]; void test(){ win[0][0] = false; for(int i = 0; i < 100; i++){ for(int j = 0; j < 100; j++){ if(i+j == 0) continue; if(i == 0 || j == 0){ win[i][j] = true; continue; } for(int k = 1; k <= i; k++){ int l = i-k; if(l == j) continue; if(!win[l][j]) win[i][j] = true; } for(int k = 1; k <= j; k++){ int l = j-k; if(l == i) continue; if(!win[i][l]) win[i][j] = true; } } } for(int i = 0; i < 10; i++){ for(int j = 0; j < 10; j++){ cout << i << ',' << j << ' ' << win[i][j] << endl; } } } int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; int a, b; cin >> a >> b; // test(); if(a > b) swap(a, b); if(a%2 == 1 && b == a+1){ cout << "Q" << endl; }else{ cout << "P" << endl; } }