#include <bits/stdc++.h>
using namespace std;
#ifdef local
#include <debug.hpp>
#else
#define debug(...)
#endif
#define rep(i, n) for (int i = 0; i < n; i++)
template <class T> istream& operator>>(istream& I, vector<T>& V) {for (T& X : V) I >> X; return I;}
template <class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
template <class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
vector<int> di = {-1, 1, 0, 0}, dj = {0, 0, -1, 1}; int inf = 2e9; long INF = 1e18;

int main() {
    int h, w;
    cin >> h >> w;
    
    vector<pair<int, int>> c;
    rep(i, h) rep(j, w) c.emplace_back(i + 1, j + 1);
    int qi = 1, qj = 1;
    while (true) {
        cout << "? " << qi << " " << qj << endl;
        int d;
        cin >> d;
        if (d == -1) {
            auto [i, j] = c[0];
            cout << "! " << i << " " << j << endl;
        }
        vector<pair<int, int>> nc;
        for (auto [i, j] : c) {
            if ((qi - i) * (qi - i) + (qj - j) * (qj - j) == d) {
                nc.emplace_back(i, j);
            } 
        }
        if (nc.size() == 1) {
            auto [i, j] = nc[0];
            cout << "! " << i << " " << j << endl;
            break;
        } else {
            if (qi == 1 and qj == 1) qi = h;
            else if (qi == h and qj == 1) qj = w;
            else if (qi == h and qj == w) qi = 1;
            else {
                qi = rand() % h + 1;
                qj = rand() % w + 1;
            }
        }
        swap(c, nc);
    }
    return 0;
}