#include <bits/stdc++.h>
using namespace std;
int n;
long long L, al[1005], ar[1005];
int arr[1005][1005] = {{},
                       {0, 0, 1, 1, 2, 3, 4, 4},
                       {0, 1, 1, 2, 2, 3, 3, 4},
                       {0, 1, 2, 2, 2, 3, 3, 4},
                       {0, 0, 0, 0, 1, 2, 3, 4}};
long long getv(int u, long long v) {
  printf("? %d %lld\n", u, v);
  fflush(stdout);
  long long r;
  scanf("%lld", &r);
  return r;
}
long long ser(int u, long long v, long long l, long long r) {
  long long m;
  for (; l < r;) {
    m = l + r >> 1;
    long long t = getv(u, m);
    if (t < v)
      l = m + 1;
    else if (t > v)
      r = m - 1;
    else
      return m;
  }
  return l;
}
int vis[1005], tim;
long long llc;
void qry(vector<int>& g, vector<int>& p, long long ql, long long qr,
         long long aim, int ls) {
  int t = g[rand() % g.size()];
  long long x = ser(t, aim, ql, qr);
  vector<int> l, r, z;
  for (int i = (0), LIM = (p.size() - 1); i <= LIM; i++)
    if (p[i] != t) {
      long long y = getv(p[i], x);
      if (y == aim) z.push_back(p[i]);
      if (y < aim) l.push_back(p[i]);
      if (y > aim) r.push_back(p[i]);
    }
  for (; l.size() < ls && !z.empty();) l.push_back(z.back()), z.pop_back();
  for (; !z.empty();) r.push_back(z.back()), z.pop_back();
  if (l.size() <= ls && r.size() < p.size() - ls) {
    g.clear();
    g.push_back(t);
    llc = x;
    return;
  }
  if (l.size() > ls) {
    ++tim;
    for (int i = (0), LIM = (l.size() - 1); i <= LIM; i++) vis[l[i]] = tim;
    for (int i = 0; i < g.size(); i++)
      if (vis[g[i]] != tim) swap(g[i], g.back()), g.pop_back(), i--;
    qry(g, p, ql, qr, aim, ls);
  } else {
    ++tim;
    for (int i = (0), LIM = (r.size() - 1); i <= LIM; i++) vis[r[i]] = tim;
    for (int i = 0; i < g.size(); i++)
      if (vis[g[i]] != tim) swap(g[i], g.back()), g.pop_back(), i--;
    qry(g, p, ql, qr, aim, ls);
  }
}
void Solve(vector<int>& p, long long ql, long long qr, long long pl,
           long long pr) {
  if (p.empty()) return;
  if (p.size() == 1) {
    al[p[0]] = ql, ar[p[0]] = qr;
    return;
  }
  vector<int> g = p;
  int m = p.size() / 2;
  qry(g, p, ql, qr, pl + (pr - pl) / p.size() * m, m);
  int t = g[0];
  vector<int> l, r, z;
  for (int i = (0), LIM = (p.size() - 1); i <= LIM; i++) {
    long long y = getv(p[i], llc);
    if (y == pl + (pr - pl) / p.size() * m) z.push_back(p[i]);
    if (y > pl + (pr - pl) / p.size() * m) l.push_back(p[i]);
    if (y < pl + (pr - pl) / p.size() * m) r.push_back(p[i]);
  }
  for (; l.size() < m;) l.push_back(z.back()), z.pop_back();
  for (; !z.empty();) r.push_back(z.back()), z.pop_back();
  long long tmp = llc;
  Solve(l, ql, tmp, pl, pl + (pr - pl) / p.size() * m);
  Solve(r, tmp, qr, pl + (pr - pl) / p.size() * m, pr);
}
int main() {
  scanf("%d%lld", &n, &L);
  vector<int> p;
  for (int i = (1), LIM = (n); i <= LIM; i++) p.push_back(i);
  Solve(p, 0, 1e18, 0, L);
  puts("!");
  for (int i = (1), LIM = (n); i <= LIM; i++)
    printf("%lld %lld\n", al[i], ar[i]);
}
