#include using namespace std; using ll = long long; #ifdef LOCAL #include #else #define debug(...) #endif int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); int H, W; cin >> H >> W; if (H == 1 && W == 1) { cout << "! " << H << " " << W << endl; } else if (H == 1) { cout << "? " << 1 << " " << 1 << endl; int d; cin >> d; for (int w = 1; w <= W; w++) { if ((w - 1) * (w - 1) == d) { cout << "! " << 1 << " " << w << endl; return 0; } } } else if (W == 1) { cout << "? " << 1 << " " << 1 << endl; int d; cin >> d; for (int h = 1; h <= H; h++) { if ((h - 1) * (h - 1) == d) { cout << "! " << h << " " << 1 << endl; return 0; } } } else { cout << "? " << 1 << " " << 1 << endl; int d1; cin >> d1; cout << "? " << 1 << " " << W << endl; int d2; cin >> d2; for (int h = 1; h <= H; h++) { for (int w = 1; w <= W; w++) { if ((h - 1) * (h - 1) + (w - 1) * (w - 1) != d1) continue; if ((h - 1) * (h - 1) + (W - w) * (W - w) != d2) continue; cout << "! " << h << " " << w << endl; return 0; } } } }