// #pragma GCC target("avx2") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") #include using namespace std; #include using namespace atcoder; #include namespace mp = boost::multiprecision; using Bint = mp::cpp_int; typedef long long ll; const ll INF = 1e18; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++) #define all(v) v.begin(), v.end() #define llpow(x, y) (ll) pow(x, y) #define llacumulate(v) accumulate(all(v), 0LL) #define endl "\n" struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } fast; template bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } #ifdef LOCAL #include #define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast(0)) #endif int main() { ll cnt = 0, point = -1, a, b, before = -1; while (true) { cout << "? " << cnt << endl; ll t; cin >> t; if (t == 0) { if (point == -1) point = cnt; else { if (before == -1) { point = -1; continue; } else { a = before; b = cnt - point; break; } } } cnt++; before = t; } cout << "! " << a << " " << b << endl; }