#include namespace { #pragma GCC diagnostic ignored "-Wunused-function" #include #pragma GCC diagnostic warning "-Wunused-function" using namespace std; using namespace atcoder; #define rep(i,n) for(int i = 0; i < (int)(n); i++) #define rrep(i,n) for(int i = (int)(n) - 1; i >= 0; i--) #define all(x) begin(x), end(x) #define rall(x) rbegin(x), rend(x) template bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; } template bool chmin(T& a, const T& b) { if (b < a) { a = b; return true; } else return false; } using ll = long long; using P = pair; using VI = vector; using VVI = vector; using VL = vector; using VVL = vector; } int main() { ios::sync_with_stdio(false); cin.tie(0); string player; cin >> player; int side = player == "Alice" ? 0 : 1; int q, n, m; cin >> q >> n >> m; vector

a(n), b(m); if (side == 0) { rep(i, n) cin >> a[i].first, a[i].second = i; } else { rep(i, m) cin >> b[i].first, b[i].second = i; } sort(all(a)); sort(all(b)); if (n < m) swap(a, b), swap(n, m), side ^= 1; int mid = (n + m - 1) / 2; int l = mid - m, r = mid + 1; int ans = 0; while (r - l > 1) { int c = (l + r) / 2; int d = mid - c; int va = a[c].first, vb = b[d].first; if (side == 0) cout << "share " << a[c].second + 1 << endl; else cout << "share " << b[d].second + 1 << endl; int res; cin >> res; (side == 0 ? vb : va) = res; chmax(ans, min(va, vb)); (va >= vb ? r : l) = c; } cout << "answer " << ans << endl; }