#include //#include using namespace std; //using namespace atcoder; using ll = long long; //using mint = modint998244353; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); /* H=1, W=1なら質問しなくて良い。 H=1 (W=1)なら1からの距離(d-1)^2から特定できる。 H>=2, W>=2なら(1, 1), (H, 1)からの距離がわかればそれらの交点はグリッド状に1つしかないのでわかる。 */ auto ans=[](int i, int j)->void{ cout << "! " << i << " " << j << endl; exit(0); }; auto ask=[](int i, int j)->int{ cout << "? " << i << " " << j << endl; int res; cin >> res; if (res == -1) exit(0); return res; }; int H, W, d, e; cin >> H >> W; if (H == 1 && W == 1) ans(1,1); if (H >= 2 && W >= 2){ d = ask(1,1); e = ask(H,1); for (int i=1; i<=H; i++){ for (int j=1; j<=W; j++){ if ((i-1)*(i-1)+(j-1)*(j-1) == d && (H-i)*(H-i)+(j-1)*(j-1) == e) ans(i, j); } } } else{ d = ask(1,1); for (int i=1; i<=H; i++){ for (int j=1; j<=W; j++){ if ((i-1)*(i-1)+(j-1)*(j-1) == d) ans(i, j); } } } return 0; }