#include using namespace std; #define For(i, a, b) for(int i = (a); i < (b); i++) #define rep(i, n) For(i, 0, n) #define rFor(i, a, b) for(int i = (a); i >= (b); i--) #define ALL(v) (v).begin(), (v).end() #define rALL(v) (v).rbegin(), (v).rend() using lint = long long; using ld = long double; int INF = 2000000000; lint LINF = 1000000000000000000; int dist(int i, int j, int ii, int jj) { int dii = abs(i - ii); int djj = abs(j - jj); return dii * dii + djj * djj; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int h, w; cin >> h >> w; auto ask = [](int i, int j) -> int { cout << "? " << i << " " << j << "\n"; cout.flush(); int d; cin >> d; return d; }; int d = ask(1, 1); vector> v; For(i, 1, h + 1) { For(j, 1, w + 1) { if (dist(i, j, 1, 1) == d) { v.emplace_back(i, j); } } } for (auto &[i, j] : v) { if (ask(i, j) == 0) { cout << "! " << i << " " << j << "\n"; cout.flush(); return 0; } } }