#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
long long a[N][N];
bool type;
int n, Qcnt;
long long V;
long long rnd() {
  long long x = 0;
  for (int i = (int)(1); i <= (int)(18); i++) x = x * 10 + rand() % 10;
  return x;
}
void init() {
  type = 1;
  for (int i = (int)(1); i <= (int)(n); i++) {
    int top = 0;
    for (; top != V;) {
      for (; top != V; a[i][++top] = rnd())
        ;
      sort(a[i] + 1, a[i] + V + 1);
      top = unique(a[i] + 1, a[i] + V + 1) - a[i] - 1;
    }
  }
}
long long query(int x, long long y) {
  ++Qcnt;
  if (type == 0) {
    printf("? %d %lld\n", x, y);
    fflush(stdout);
    scanf("%lld", &y);
    return y;
  } else {
    int pos = upper_bound(a[x] + 1, a[x] + V * n + 1, y) - a[x] - 1;
    return pos;
  }
}
int id[N], idd[N];
long long val[N], ansR[N], ansL[N];
bool cmp(int x, int y) { return val[x] < val[y]; }
map<pair<long long, long long>, long long> mp;
long long find(int x, long long L, long long R, long long val) {
  if (mp.find(pair<long long, long long>(x, val)) != mp.end())
    return mp[pair<long long, long long>(x, val)];
  long long ans = 0;
  for (; L <= R;) {
    long long mid = (L + R) / 2;
    long long v = query(x, mid);
    if (v == val) ans = mid;
    if (v >= val)
      R = mid - 1;
    else
      L = mid + 1;
  }
  return mp[pair<long long, long long>(x, val)] = ans;
}
void divide(long long L, long long R, long long l, long long r) {
  if (l > r) return;
  if (L == R) {
    for (int i = (int)(l); i <= (int)(r); i++) ansR[id[i]] = L;
    return;
  }
  if (l == r) {
    ansR[id[l]] = find(id[l], L, R, l * V);
    assert(ansR[id[l]] != 0);
    return;
  }
  int mid = (l + r) / 2;
  int pl = l, pr = r;
  long long LL = L, RR = R;
  for (;;) {
    int speP = id[pl + rand() % (pr - pl + 1)];
    long long pos = find(speP, LL, RR, mid * V);
    int plll = pl, prrr = pr;
    for (int i = (int)(pl); i <= (int)(pr); i++) {
      long long val = query(id[i], pos);
      if (val > mid * V || (val == mid * V && id[i] <= speP))
        idd[plll++] = id[i];
      else
        idd[prrr--] = id[i];
    }
    for (int i = (int)(pl); i <= (int)(pr); i++) id[i] = idd[i];
    if (prrr <= mid)
      pl = prrr + 1, LL = pos;
    else
      pr = plll - 1, RR = pos;
    if (pr <= mid || pl > mid) break;
  }
  divide(L, RR, l, mid);
  divide(LL, R, mid + 1, r);
}
void output() {
  for (int i = (int)(1); i <= (int)(n); i++) ansL[id[i]] = ansR[id[i - 1]];
  printf("!\n");
  for (int i = (int)(1); i <= (int)(n); i++)
    printf("%lld %lld\n", ansL[i], ansR[i]);
  fflush(stdout);
}
int main() {
  scanf("%d%lld", &n, &V);
  srand(time(NULL));
  V /= n;
  for (int i = (int)(1); i <= (int)(n); i++) id[i] = i;
  divide(0, 1000000000000000000ll, 1, n);
  output();
}
