#include "atcoder/fenwicktree.hpp" #include #include using namespace std; using isize = size_t; using i32 = int; using u32 = unsigned int; using i64 = long long; using u64 = unsigned long long; using i128 = __int128_t; using u128 = __uint128_t; using f64 = long double; using p2 = pair; using el = tuple; using mint = atcoder::modint998244353; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); } i64 pow(i64 x, i64 n) { i64 res = 1; i64 t = x; while (n > 0) { if (n & 1) { res = res * t; } t = t * t; n >>= 1; } return res; } i64 pow(i64 x, i64 n, i64 m) { i64 res = 1; i64 t = x % m; while (n > 0) { if (n & 1) { res = res * t % m; } t = t * t % m; n >>= 1; } return res; } vector> mul(vector> &a, vector> &b) { vector> res(a.size(), vector(b[0].size(), 0)); assert(a[0].size() == b.size()); for (i64 i = 0; i < a.size(); i++) { for (i64 j = 0; j < b[0].size(); j++) { for (i64 k = 0; k < b.size(); k++) { res[i][j] += a[i][k] * b[k][j]; } } } return res; } vector> pow(vector> &a, i64 n) { assert(a.size() == a[0].size()); vector> res(a.size(), vector(a[0].size(), 0)); vector> t = a; for (i64 i = 0; i < a.size(); i++) res[i][i] = 1; while (n > 0) { if (n & 1) { vector> nres = mul(res, t); swap(res, nres); } vector> nt = mul(t, t); swap(nt, t); n >>= 1; } return res; } void _main() { i64 y; i64 cnt = 0; { map mp; for (i64 k = 0; k < 100; k++) { cout << "? B\n"; cout.flush(); cin >> y; mp[y]++; cnt++; } i64 mx = -1; for (auto [c, k] : mp) { if (mx < c) y = k, mx = c; } } char t = 'A', res = 'C', em = 'B'; while (y > 0) { if (y & 1) { for (i64 k = 0; k < 20; k++) { cout << "+ " << res << " " << t << " " << em << "\n"; cout.flush(); i64 ok; cin >> ok; assert(ok == 0); cnt++; } swap(res, em); } for (i64 k = 0; k < 20; k++) { cout << "+ " << t << " " << t << " " << em << "\n"; cout.flush(); i64 ok; cin >> ok; assert(ok == 0); cnt++; } swap(t, em); y >>= 1; } cout << "! " << res << "\n"; cout.flush(); }