Problem: As you all know, the plum harvesting season is on! Little Milutin had his plums planted in an orchard that can be represented as an n by m matrix. While he was harvesting, he wrote the heights of all trees in a matrix of dimensions n by m.

At night, when he has spare time, he likes to perform various statistics on his trees. This time, he is curious to find out the height of his lowest tree. So far, he has discovered some interesting properties of his orchard. There is one particular property that he thinks is useful for finding the tree with the smallest heigh.

Formally, let L(i) be the leftmost tree with the smallest height in the i-th row of his orchard. He knows that L(i) ≤ L(i+1) for all 1 ≤ i ≤ n - 1. Moreover, if he takes a submatrix induced by any subset of rows and any subset of columns, L(i) ≤ L(i+1) will hold for all 1 ≤ i ≤ n'-1, where n' is the number of rows in that submatrix.

Since the season is at its peak and he is short on time, he asks you to help him find the plum tree with minimal height.

Input

This problem is interactive.

The first line of input will contain two integers n and m, representing the number of rows and the number of columns in Milutin's orchard. It is guaranteed that 1 ≤ n, m ≤ 10^6.

The following lines will contain the answers to your queries.

Output

Once you know have found the minimum value r, you should print ! r to the standard output.

Interaction

Your code is allowed to query for an entry (i, j) of a matrix (i.e. get the height of the tree which is in the i-th row and j-th column). The query should be formatted as ? i j, so that 1 ≤ i ≤ n and 1 ≤ j ≤ m.

You may assume that the entries of the matrix will be integers between 1 and 10^9.

Your solution should use not more than 4 ⋅ (n + m) queries.

This is an interactive problem. You have to use a flush operation right after printing each line. For example, in C++ you should use the function fflush(stdout), in Java — System.out.flush(), in Pascal — flush(output) and in Python — sys.stdout.flush().

Example

Input


5 5
13 15 10 9 15
15 17 12 11 17
10 12 7 6 12
17 19 14 13 19
16 18 13 12 18


Output

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
string to_string(char c) { return string(1, c); }
string to_string(bool b) { return b ? "true" : "false"; }
string to_string(const char* s) { return string(s); }
string to_string(string s) { return s; }
string to_string(vector<bool> v) {
  string res;
  for (int i = 0; i < (int)v.size(); i++) res += char('0' + v[i]);
  return res;
}
template <size_t second>
string to_string(bitset<second> b) {
  string res;
  for (int i = 0; i < second; i++) res += char('0' + b[i]);
  return res;
}
template <class T>
string to_string(T v) {
  bool f = 1;
  string res;
  for (auto x : v) {
    if (!f) res += ' ';
    f = 0;
    res += to_string(x);
  }
  return res;
}
void DBG() { cerr << "]" << endl; }
template <class H, class... T>
void DBG(H h, T... t) {
  cerr << to_string(h);
  if (sizeof...(t)) cerr << ", ";
  DBG(t...);
}
const int INF = 1e9 + 7;
bool local = false;
int a[100][100];
map<pair<int, int>, int> save;
int ask(int x, int y) {
  if (local)
    return a[x - 1][y - 1];
  else {
    if (save.count({x, y})) return save[{x, y}];
    cout << "? " << x << " " << y << endl;
    cin >> save[{x, y}];
    return save[{x, y}];
  }
}
vector<int> reduce(vector<int> rows, vector<int> cols) {
  vector<int> stk;
  for (int i = 0; i < cols.size(); i++) {
    while (true) {
      if (stk.empty()) {
        stk.push_back(cols[i]);
        break;
      } else {
        if (ask(rows[stk.size() - 1], stk.back()) <=
            ask(rows[stk.size() - 1], cols[i])) {
          if (stk.size() + 1 <= rows.size()) {
            stk.push_back(cols[i]);
            break;
          } else {
            break;
          }
        } else {
          stk.pop_back();
        }
      }
    }
  }
  return stk;
}
vector<int> SMAWK(vector<int> rows, vector<int> cols) {
  if (rows.empty()) return vector<int>();
  if (rows.size() < cols.size()) cols = reduce(rows, cols);
  vector<int> rec_rows;
  for (int i = 1; i < rows.size(); i += 2) rec_rows.push_back(rows[i]);
  vector<int> rec_cols = SMAWK(rec_rows, cols);
  vector<int> ans_cols;
  int last_idx = 0;
  for (int i = 0; i < rows.size(); i++) {
    if (i & 1)
      ans_cols.push_back(rec_cols[i / 2]);
    else {
      int nxt_col = cols.back();
      if (i + 1 < rows.size()) nxt_col = rec_cols[(i + 1) / 2];
      int mn = ask(rows[i], cols[last_idx]), mn_col = cols[last_idx];
      while (last_idx + 1 < cols.size() && cols[last_idx + 1] <= nxt_col) {
        last_idx++;
        int nw = ask(rows[i], cols[last_idx]);
        if (nw < mn) mn = nw, mn_col = cols[last_idx];
      }
      ans_cols.push_back(mn_col);
    }
  }
  return ans_cols;
}
signed main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  if (local)
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) cin >> a[i][j];
  vector<int> rows, cols;
  for (int i = 1; i <= n; i++) rows.push_back(i);
  for (int i = 1; i <= m; i++) cols.push_back(i);
  vector<int> mn_cols = SMAWK(rows, cols);
  int mn = INF;
  for (int i = 0; i < n; i++) mn = min(mn, ask(rows[i], mn_cols[i]));
  cout << "! " << mn << endl;
}