//#include #include using namespace std; typedef long long ll; #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() const int MAX = 1e9; const int MIN = -1*1e9; const ll MAXLL = 1e18; const ll MINLL = -1*1e18; int main() { char C; cin >> C; set> Ans; vector> Count(200); for(int i = 0; i < 200; i++) Count[i] = {MAX,'?'}; for(char i = 'a'; i <= 'z'; i++) Count[i] = {26,i}; cout << "?" << " " << C << C << endl; Ans.insert({C,C}); Count[C].first--; while(true) { string S,S2; cin >> S2 >> S; if(S2 == "!") return 0; Ans.insert({S[0],S[1]}); Count[S[0]].first--; sort(all(Count)); for(int i = 0; i < 100; i++) { char A = S[1]; char B = Count[i].second; if(!Ans.count({A,B})) { cout << "?" << " " << A << B << endl; } else continue; Count[A].first--; Ans.insert({A,B}); break; } } return 0; }