#include <bits/stdc++.h>
using namespace std;
const int N = 505;
int n, fa[N], sz[N];
vector<int> S, T;
int ask(vector<int> &S, vector<int> &T, int x) {
  cout << S.size() << endl;
  for (int z : S) cout << z << " ";
  puts("");
  cout << T.size() << endl;
  for (int z : T) cout << z << " ";
  puts("");
  cout << x << endl;
  scanf("%d", &x);
  return x;
}
int main() {
  cin >> n;
  S.push_back(1);
  sz[1] = n;
  for (int i = 2; i <= n; i++) T.push_back(i);
  for (int i = 2; i <= n; i++) sz[i] = ask(S, T, i);
  static int p[N];
  for (int i = 1; i <= n; i++) p[i] = i;
  sort(p + 1, p + n + 1,
       [](const int &i, const int &j) { return sz[i] < sz[j]; });
  vector<int> A;
  for (int i = 1, x; i < n; i++) {
    x = p[i];
    while (A.size() && ask(S, A, x)) {
      int l = 0, r = A.size() - 1;
      while (l < r) {
        int mid = (l + r) >> 1;
        T.clear();
        for (int j = 0; j <= mid; j++) T.push_back(A[j]);
        if (ask(S, T, x))
          r = mid;
        else
          l = mid + 1;
      }
      fa[A[l]] = x;
      A.erase(A.begin() + l);
    }
    A.push_back(x);
  }
  puts("ANSWER");
  for (int z : A) fa[z] = 1;
  for (int i = 2; i <= n; i++) cout << i << " " << fa[i] << '\n';
}
