#include <bits/stdc++.h>
using namespace std;
int fa[1010];
bool exist_ch(vector<int> s, int x) {
  if (s.empty()) return 0;
  sort(s.begin(), s.end());
  int nn = s.size();
  if (s[0] == 1) swap(s[0], s[nn - 1]), s.pop_back(), --nn;
  if (s.empty()) return 0;
  printf("1\n1\n");
  printf("%d\n", nn);
  for (int i = 0; i < nn; ++i) printf("%d ", s[i]);
  printf("\n%d\n", x);
  int xx;
  cin >> xx;
  fflush(stdout);
  return xx;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<int> s, t, p;
  s.push_back(1), s.push_back(2);
  for (int i = 3; i <= n; ++i) {
    int l = 0, r = i - 2, z = 0;
    while (l <= r) {
      int mid = (l + r) >> 1;
      p.clear();
      for (int j = 0; j <= mid; ++j) p.push_back(s[j]);
      if (!exist_ch(p, i))
        z = mid, l = mid + 1;
      else
        r = mid - 1;
    }
    s.push_back(i);
    for (int j = i - 2; j > z; --j) swap(s[j], s[j + 1]);
  }
  for (int i = n - 1; ~i; --i) {
    int x = s[i];
    while (exist_ch(t, x)) {
      int l = 0, r = t.size() - 1, m = t.size() - 1;
      while (l < r) {
        int mid = (l + r) >> 1;
        p.clear();
        for (int j = l; j <= mid; ++j) p.push_back(t[j]);
        if (exist_ch(p, x))
          r = mid;
        else
          l = mid + 1;
      }
      fa[t[l]] = x;
      swap(t[l], t[m]), t.pop_back();
    }
    t.push_back(x);
  }
  puts("ANSWER");
  for (int i = 2; i <= n; ++i) printf("%d %d\n", fa[i], i);
  return 0;
}
