#include <bits/stdc++.h> using namespace std; using ll = long long; #ifdef LOCAL #include <debug.hpp> #else #define debug(...) #endif // N は平方数, 0 <= N <= 4.5*10^18 < 2^62 ll integer_sqrt(ll N) { // √N < 2^31 ll low = -1, high = 1LL << 31; while (high - low > 1) { ll mid = (low + high) / 2, mid2 = mid * mid; if (mid2 <= N) { low = mid; } else { high = mid; } } return low; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); int H, W; cin >> H >> W; // int local_h = 114, local_w = 514; vector<int> res(W + 1, -1); auto check = [&](int h) -> int { if (res[h] != -1) return res[h]; cout << h << " " << 1 << endl; // int d = (local_h - h) * (local_h - h) + (local_w - 1) * (local_w - 1); int d; cin >> d; if (d == -1) assert(false); return res[h] = d; }; int left = 0, right = H + 1; // 三分探索 while (right - left > 2) { int m1 = left + (right - left) / 3; int m2 = right - (right - left) / 3; if (check(m1) > check(m2)) { left = m1; } else { right = m2; } } int h = left + 1, d = check(left + 1); int w = integer_sqrt(d) + 1; cout << "! " << h << " " << w << endl; }