Language: C++

#pragma GCC optimze("Ofast")
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#ifndef rd
#define trace(...)
//#define endl '\n'
#endif
#define pb push_back
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double f80;
#define double long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
const ll infl=0x3f3f3f3f3f3f3f3fLL;
const int infi=0x3f3f3f3f;
//const int mod=998244353;
const int mod=1000000007;
typedef vector<int> vi;
typedef vector<ll> vl;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> oset;
auto clk=clock();
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}
int powm(int a, int b) {
	int res=1;
	while(b) {
		if(b&1)
			res=(res*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return res;
}


vector<char> poo;
int cnt[62];
void solve() {
	poo(62);
	iota(poo.begin(),poo.begin()+26,'a');
	iota(poo.begin()+26,poo.begin()+52,'A');
	iota(poo.begin()+52,poo.begin()+62,'0');
	int lenth=0;
	bool done=0;
	for(char i:poo) {
		cout<<"? "<<i<<endl;
		int te;
		cin>>te;
		if(lenth==0)
			lenth=te;
		else if(lenth!=te) {
			lenth=max(lenth,te);
			done=1;
			break;
		}
	}
	if(done==0)
		lenth++;
	string ans="";
	rep(i,0,62) {
		cout<<"? "<<string(lenth,poo[i])<<endl;
		int te;
		cin>>te;
		rep(j,0,te)
			ans+=poo[i];
	}
	int dist;
	cout<<"? "<<ans<<endl;
	cin>>dist;
	while(dist) {
		string ans2=ans;
		int tem;
		if(dist>50) {
			random_shuffle(all(ans2));
			cout<<"? "<<ans2<<endl;
			cin>>tem;
			if(tem<dist) {
				ans=ans2;
				dist=tem;
			}
		} else if(dist>10) {
			rep(j,0,20)
				swap(ans2[rng(lenth)],ans2[rng(lenth)]);
			cout<<"? "<<ans2<<endl;
			cin>>tem;
			if(tem<dist) {
				ans=ans2;
				dist=tem;
			}
		} else if(dist>5) {
			rep(j,0,5)
				swap(ans2[rng(lenth)],ans2[rng(lenth)]);
			cout<<"? "<<ans2<<endl;
			cin>>tem;
			if(tem<dist) {
				ans=ans2;
				dist=tem;
			}
		} else {
			swap(ans2[rng(lenth)],ans2[rng(lenth)]);
			cout<<"? "<<ans2<<endl;
			cin>>tem;
			if(tem<dist) {
				ans=ans2;
				dist=tem;
			}
		}
	}
	cout<<"! "<<ans<<endl;
}

signed main() {
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	srand(chrono::high_resolution_clock::now().time_since_epoch().count());
	cout<<fixed<<setprecision(8);
	int t=1;
//	cin>>t;
	fr(i,1,t) {
		solve();
	}
#ifdef rd
	cout<<endl<<endl<<endl<<endl<<"Time elapsed: "<<(double)(clock()-clk)/CLOCKS_PER_SEC<<endl;
#endif
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:56:12: error: no match for call to '(std::vector<char>) (int)'
   56 |         poo(62);
      |         ~~~^~~~
a.cc:91:39: warning: 'void std::random_shuffle(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >]' is deprecated: use 'std::shuffle' instead [-Wdeprecated-declarations]
   91 |                         random_shuffle(all(ans2));
      |                         ~~~~~~~~~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:4492:5: note: declared here
 4492 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~~~~~~~