#include using namespace std; using ll = long long; //#define DEBUG int X = 2, Y = 3, Z = 0; vector A = {2, 3, 0}; unsigned long long xor64() { static unsigned long long x = (unsigned long long)(chrono::duration_cast( chrono::high_resolution_clock::now().time_since_epoch()).count()) * 10150724397891781847ULL; x ^= x << 7; return x ^= x >> 9; } int main(){ ios::sync_with_stdio(false); cin.tie(0); constexpr int r = 19; array tmp; auto ask1 = [&](char c){ for(int i = 0; i < r; i++){ cout << "? " << c << endl; #ifndef DEBUG cin >> tmp[i]; #else tmp[i] = xor64() % 10 < 8 ? A[c - 'A'] : xor64() % 1000; #endif } sort(tmp.begin(), tmp.end()); pair mx; for(int i = 0; i < r; ){ int p = i; while(i < r && tmp[i] == tmp[p]) i++; mx = max(mx, make_pair(i - p, tmp[p])); } return mx.second; }; auto ask2 = [&](char c0, char c1, char c2){ int res; cout << "+ " << c0 << " " << c1 << " " << c2 << endl; #ifndef DEBUG cin >> res; assert(res == 0); #else A[c2 - 'A'] = xor64() % 10 < 8 ? A[c0 - 'A'] + A[c1 - 'A'] : xor64() % 1000; #endif }; int x = ask1('A'); int y = ask1('B'); int v = 0; char c0 = 'A', c1 = 'B', c2 = 'C'; while(y){ if(y & 1){ v += x; do{ ask2(c0, c2, c1); }while(ask1(c1) != v); swap(c1, c2); } do{ ask2(c0, c0, c1); }while(ask1(c1) != 2 * x); x += x; swap(c0, c1); y /= 2; } cout << "! " << c2 << endl; }