#include <bits/stdc++.h>
using namespace std;
vector<int> ask(vector<int> d) {
  printf("? ");
  for (int i : d) printf("%d ", i);
  cout << endl;
  string s;
  cin >> s;
  vector<int> r;
  for (int i = 0; i < d.size(); i++) r.push_back(s[i] - '0');
  return r;
}
int n, vi[1010], va[1010];
vector<int> nt[1010], p, c[1010];
int main() {
  cin >> n;
  vi[0] = vi[n] = 1;
  c[0].push_back(0);
  for (int i = 1; i < n; i++) nt[0].push_back(i);
  while (1) {
    int ok = 1;
    p.clear();
    for (int i = 0; i <= n; i++)
      if (vi[i]) p.push_back(i);
    for (int s = 0; s < 2; s++) {
      vector<int> a, b;
      a.resize(n);
      b.resize(n);
      for (int i = s; i + 1 < p.size(); i += 2)
        if (!c[p[i]].empty() && p[i + 1] != p[i] + 1) {
          if (p[i + 1] == p[i] + 2) {
            c[p[i] + 1] = nt[p[i]];
            nt[p[i]].clear();
            vi[p[i] + 1] = 1;
            continue;
          }
          ok = 0;
          int md = (p[i] + p[i + 1] + 1) / 2;
          for (int x : c[p[i]]) {
            a[x] = md - p[i] - 1;
            b[x] = a[x] + 1;
          }
        }
      vector<int> q1 = ask(a), q2 = ask(b);
      for (int i = s; i + 1 < p.size(); i += 2)
        if (!c[p[i]].empty() && p[i + 1] > p[i] + 2) {
          int md = (p[i] + p[i + 1] + 1) / 2;
          vector<int> nw = nt[p[i]];
          nt[p[i]].clear();
          for (int x : nw) {
            if (q1[x])
              nt[p[i]].push_back(x);
            else if (q2[x])
              c[md].push_back(x);
            else
              nt[md].push_back(x);
          }
          vi[md] = 1;
        }
    }
    if (ok) break;
  }
  for (int s = 1; s <= 3; s++)
    for (int i = 0; (1 << i) < n; i++) {
      vector<int> a;
      a.resize(n);
      int ok = 0;
      for (int x = s; x < n; x += 3)
        if (!c[x].empty())
          for (int j : c[x - 1])
            if (j & (1 << i)) {
              a[j] = 1;
              ok = 1;
            }
      if (!ok) continue;
      vector<int> q1 = ask(a);
      for (int x = s; x < n; x += 3)
        if (!c[x].empty())
          for (int j : c[x])
            if (q1[j]) va[j] += (1 << i);
    }
  cout << '!' << endl;
  for (int i = 1; i < n; i++) cout << va[i] + 1 << ' ' << i + 1 << '\n';
}
