#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; #define rep(i, n) for (int i = 0; i < (int)(n); i++) template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } int main() { double H,W; cin >> H >> W; if(H == 1 && W == 1){ cout << "! 1 1" << endl; return 0; } cout << "? 1 1" << endl; double a; cin >> a; if(a == 0)cout << "! 1 1" << endl; // a = sqrt(a); vector<vector<bool>> res(H,vector<bool>(W,true)); int counter = H * W; rep(i,H)rep(j,W){ if(i*i+j*j - a)res[i][j] = false; counter--; } if(counter == 1){ rep(i,H)rep(j,W){ if(res[i][j])cout << "! " << i+1 << " " << j+1 << endl; return 0; } } cout << "? " << H << " " << W << endl; cin >> a; if(a == 0)cout << "! " << H << " " << W << endl; // a = sqrt(a); rep(i,H)rep(j,W){ if((H-i-1)*(H-i-1) + (W-j-1) * (W-j-1) - a)res[i][j] = false; counter--; } if(counter == 1){ rep(i,H)rep(j,W){ if(res[i][j])cout << "! " << i+1 << " " << j+1 << endl; return 0; } }else{ vector<pair<int,int>> candidateList; rep(i,H)rep(j,W){ if(res[i][j])candidateList.push_back({i+1,j+1}); } // cout << candidateList.size() << endl; cout << "? " << candidateList[0].first << " " << candidateList[0].second << endl; cin >> a; if(a)cout << "! " << candidateList[1].first << " " << candidateList[1].second << endl; else cout << "! " << candidateList[0].first << " " << candidateList[0].second << endl; } }