#include <bits/stdc++.h>
using namespace std;
const int N_MAX = 500;
int n, s[N_MAX], p[N_MAX], id[N_MAX];
vector<int> act, tmp;
bool mysort(int i1, int i2) { return s[i1] < s[i2]; }
int ask(int v, int a, int b) {
  cout << b - a + 1 << "\n";
  for (int i = a; i <= b; i++) cout << act[i] + 1 << " ";
  cout << "\n";
  cout << "1\n";
  cout << "1\n";
  cout << v + 1 << "\n";
  cout.flush();
  int ans;
  cin >> ans;
  return ans;
}
void get_children(int v, int a, int b) {
  if (a == b) {
    p[act[a]] = v;
    act[a] = -1;
    return;
  }
  int k = (a + b) / 2;
  bool left = ask(v, a, k);
  if (left) get_children(v, a, k);
  if (!left || ask(v, k + 1, b)) get_children(v, k + 1, b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  s[0] = n;
  for (int u = 1; u < n; u++) {
    cout << n - 1 << "\n";
    for (int i = 1; i < n; i++) cout << i + 1 << " ";
    cout << "\n";
    cout << "1\n";
    cout << "1\n";
    cout << u + 1 << "\n";
    cout.flush();
    cin >> s[u];
  }
  for (int i = 0; i < n; i++) id[i] = i;
  sort(id, id + n, mysort);
  for (int i = 0; i < n; i++) p[i] = -1;
  for (int i = 0; i < n - 1; i++) {
    if (s[id[i]] == 1) {
      act.push_back(id[i]);
      continue;
    }
    int v = id[i];
    get_children(v, 0, act.size() - 1);
    tmp = act;
    act.clear();
    for (int x : tmp)
      if (x != -1) act.push_back(x);
    act.push_back(v);
  }
  for (int u : act) p[u] = 0;
  cout << "ANSWER\n";
  for (int i = 1; i < n; i++) cout << i + 1 << " " << p[i] + 1 << "\n";
  cout.flush();
  return 0;
}
