#include <bits/stdc++.h>
using std::abs;
using std::bitset;
using std::cerr;
using std::cin;
using std::cout;
using std::map;
using std::max;
using std::min;
using std::pair;
using std::set;
using std::sort;
using std::string;
using std::swap;
using std::unordered_map;
using std::unordered_set;
using std::vector;
using ll = long long;
using uint = unsigned int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ull = unsigned long long;
using ld = long double;
template <typename T>
void _dbg(const char* s, T h) {
  cerr << s << " = " << h << "\n";
}
template <typename T, typename... Ts>
void _dbg(const char* s, T h, Ts... t) {
  int b = 0;
  while (((b += *s == '(') -= *s == ')') != 0 || *s != ',') cerr << *s++;
  cerr << " = " << h << ",";
  _dbg(s + 1, t...);
}
struct init {
  init() {
    cin.tie(0);
    std::iostream::sync_with_stdio(0);
    cout << std::fixed << std::setprecision(10);
    cerr << std::fixed << std::setprecision(5);
  }
  ~init() {}
} init;
template <typename T, typename U>
void upx(T& x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
void upn(T& x, U y) {
  if (x > y) x = y;
}
const ll N = 1019;
ll n;
ll d[N];
vector<ll> ask() {
  cout << "? ";
  for (ll i = 1; i <= n; ++i) {
    cout << d[i] << ' ';
  }
  cout << std::endl;
  vector<ll> res(n + 1);
  for (ll i = 0; i < (n); ++i) {
    char c;
    cin >> c;
    res[i + 1] = c - '0';
  }
  return res;
}
vector<ll> lev[N], kek[N];
ll first[N];
int32_t main() {
  cin >> n;
  vector<ll> v = {0, n};
  for (ll i = 2; i <= n; ++i) kek[0].emplace_back(i);
  lev[0].emplace_back(1);
  while (v.size() != n + 1) {
    ll second = v.size();
    vector<ll> w;
    for (ll start = 0; start < (2); ++start) {
      for (ll i = 1; i <= n; ++i) d[i] = 0;
      for (ll i = start; i + 1 < second; i += 2) {
        if (v[i + 1] != v[i] + 1)
          for (ll p : lev[v[i]]) d[p] = (v[i + 1] - v[i]) / 2 - 1;
      }
      vector<ll> q1 = ask();
      for (ll i = 1; i <= n; ++i) d[i] = 0;
      for (ll i = start; i + 1 < second; i += 2) {
        if (v[i + 1] != v[i] + 1)
          for (ll p : lev[v[i]]) d[p] = (v[i + 1] - v[i]) / 2;
      }
      vector<ll> q2 = ask();
      for (ll i = start; i + 1 < second; i += 2) {
        if (v[i + 1] != v[i] + 1) {
          ll z = v[i] + (v[i + 1] - v[i]) / 2;
          w.emplace_back(z);
          vector<ll> tmp;
          for (ll p : kek[v[i]]) {
            if (!q1[p] && q2[p]) {
              lev[z].emplace_back(p);
            }
            if (!q1[p] && !q2[p]) kek[z].emplace_back(p);
            if (q1[p] && q2[p]) tmp.emplace_back(p);
          }
          kek[v[i]] = tmp;
        }
      }
    }
    for (ll i : w) v.emplace_back(i);
    sort(v.begin(), v.end());
  }
  for (ll rest = 0; rest < (3); ++rest) {
    for (ll bit = 0; bit < (10); ++bit) {
      memset(d, 0, sizeof d);
      for (ll i = rest; i < n; i += 3)
        for (ll j : lev[i])
          if (j >> bit & 1) d[j] = 1;
      vector<ll> res = ask();
      for (ll i = rest; i < n; i += 3)
        for (ll j : lev[i + 1])
          if (res[j]) first[j] += 1 << bit;
    }
  }
  cout << "!\n";
  for (ll i = 2; i <= n; ++i) {
    cout << first[i] << ' ' << i << '\n';
  }
  return 0;
}
