#include <bits/stdc++.h>
using namespace std;
string query(vector<int> v) {
  printf("?");
  for (auto &x : v) printf(" %d", x);
  puts("");
  fflush(stdout);
  string ret;
  cin >> ret;
  return ret;
}
int n, fa[1010];
bool vis[1010];
vector<int> d[1010], l[1010];
vector<int> L, R;
int main() {
  scanf("%d", &n);
  vis[0] = vis[n] = 1;
  l[0].push_back(0);
  for (int i = 1; i < n; i++) d[0].push_back(i);
  while (1) {
    bool flag = 0;
    vector<int> p;
    for (int i = 0; i <= n; i++) {
      if (vis[i]) p.push_back(i);
    }
    for (int st = 0; st < 2; st++) {
      L.clear();
      L.resize(n);
      R.clear();
      R.resize(n);
      for (int i = st; i + 1 < p.size(); i += 2) {
        if (l[p[i]].empty() || p[i + 1] == p[i] + 1) continue;
        if (p[i + 1] == p[i] + 2) {
          l[p[i] + 1] = d[p[i]];
          vis[p[i] + 1] = 1;
          continue;
        }
        flag = 1;
        int mid = (p[i] + p[i + 1]) >> 1;
        for (auto &x : l[p[i]]) {
          L[x] = mid - p[i] - 1;
          R[x] = mid - p[i];
        }
      }
      string sl = query(L), sr = query(R);
      for (int i = st; i + 1 < p.size(); i += 2) {
        if (l[p[i]].empty() || p[i + 1] == p[i] + 1) continue;
        if (p[i + 1] == p[i] + 2) continue;
        int mid = (p[i] + p[i + 1]) >> 1;
        vector<int> tmp;
        for (auto &x : d[p[i]]) {
          if (sl[x] == '1')
            tmp.push_back(x);
          else if (sr[x] == '1')
            l[mid].push_back(x);
          else
            d[mid].push_back(x);
        }
        d[p[i]] = tmp;
        vis[mid] = 1;
      }
    }
    if (!flag) break;
  }
  for (int st = 1; st <= 3; st++) {
    for (int i = 0; (1 << i) < n; i++) {
      vector<int> q(n);
      for (int j = st; j < n; j += 3) {
        if (!l[j].empty()) {
          for (auto &x : l[j - 1]) {
            if ((x >> i) & 1) q[x] = 1;
          }
        }
      }
      string tmp = query(q);
      for (int j = st; j < n; j += 3) {
        if (!l[j].empty()) {
          for (auto &x : l[j]) {
            if (tmp[x] == '1') fa[x] |= (1 << i);
          }
        }
      }
    }
  }
  puts("!");
  for (int i = 1; i < n; i++) printf("%d %d\n", fa[i] + 1, i + 1);
  return 0;
}
