#include <bits/stdc++.h>
using namespace std;
int main() {
    cout << "!" << endl;
    priority_queue<pair<int,int> > Q;
    cout << "A" << endl;
    Q.push(pair<int,int>(1,2));
    cout << "B" << endl;
    Q.push(pair<int,int>(3,2));

    pair<int,int> t = Q.top();
    cout << t.first << " ?\n";
    
    return 0;
}