#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char c = getchar();
  int x = 0;
  bool f = 0;
  for (; !isdigit(c); c = getchar()) f ^= !(c ^ 45);
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  if (f) x = -x;
  return x;
}
int n, sz[505], p[505];
bool cmp(int x, int y) { return sz[x] < sz[y]; }
set<int> s;
bool check(int u, int l, int r) {
  auto it = s.begin();
  for (register int i = (1); i <= (l - 1); ++i) ++it;
  cout << r - l + 1 << endl;
  for (register int i = (1); i <= (r - l + 1); ++i) cout << (*it) << " ", ++it;
  cout << endl;
  cout << 1 << endl << 1 << endl << u << endl;
  int x;
  cin >> x;
  return x > 0;
}
vector<pair<int, int> > qwq;
signed main() {
  cin >> n;
  sz[1] = n;
  for (register int i = (2); i <= (n); ++i) {
    cout << 1 << endl << 1 << endl;
    cout << n - 1 << endl;
    for (register int j = (2); j <= (n); ++j) cout << j << " ";
    cout << endl;
    cout << i << endl;
    cin >> sz[i];
  }
  for (register int i = (2); i <= (n); ++i) p[i] = i;
  sort(p + 2, p + n + 1, cmp);
  for (register int i = (2); i <= (n); ++i) {
    int u = p[i];
    int p = 0;
    vector<int> o;
    while (p < s.size()) {
      int l = p + 1, r = s.size(), res = -1;
      if (!check(u, l, r)) break;
      while (l <= r) {
        int mid = l + r >> 1;
        if (check(u, p + 1, mid))
          res = mid, r = mid - 1;
        else
          l = mid + 1;
      }
      auto it = s.begin();
      for (register int j = (1); j <= (res - 1); ++j) ++it;
      o.push_back(*it);
      p = res;
    }
    for (auto x : o) s.erase(x), qwq.push_back(make_pair(x, u));
    s.insert(u);
  }
  cout << "ANSWER" << endl;
  for (auto x : s) qwq.push_back(make_pair(x, 1));
  for (auto x : qwq) cout << x.first << ' ' << x.second << endl;
  return 0;
}
