#include using namespace std; int main() { int a, b; cin >> a >> b; if(abs(a - b) == 1){ cout << "Q" << endl; } else{ cout << "P" << endl; } }