#include using namespace std; #define ll long long #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define Pr pair #define Tp tuple using Graph = vector>; const ll mod = 1000000007; //累乗 aのb乗、正しmを法として求める long long pw(long long a,long long b,long long m){ if(b==0) return 1; else if(b%2==0){ long long x = pw(a,b/2,m); return (x*x)%m; } else{ long long x = pw(a,b-1,m); return (a*x)%m; } } int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); ll A,B; cin >> A >> B; string ans = "P"; if((abs(A-B)==1&&min(A,B)%2==1)||(A==B&&A%2==1)) ans = "Q"; cout << ans << endl; }