#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y, long long int m) {
  if (y == 0) return 1;
  long long int p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
long long int nCr(long long int n, long long int r, long long int m) {
  if (r > n) return 0;
  long long int a = 1, b = 1, i;
  for (i = 0; i < r; i++) {
    a = (a * n) % m;
    --n;
  }
  while (r) {
    b = (b * r) % m;
    --r;
  }
  return (a * power(b, m - 2, m)) % m;
}
void solve() {
  int n, m;
  cin >> n >> m;
  vector<long long int> v(m);
  for (int i = 0; i < m; ++i) {
    cout << "? " << 1 << " " << i + 1 << endl;
    cin >> v[i];
  }
  long long int mn = v[0];
  for (int i = 0; i < n; ++i) {
    long long int temp;
    cout << "? " << i + 1 << " " << 1 << endl;
    cin >> temp;
    mn = min(mn, temp);
  }
  long long int ans;
  ans = mn;
  for (int i = 0; i < m; ++i) {
    mn += v[i + 1] - v[i];
    ans = min(ans, mn);
  }
  cout << "! " << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
