#include <bits/stdc++.h>
using namespace std;
void read(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -f;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  x *= f;
}
void print(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (!x) return;
  print(x / 10), putchar(x % 10 + 48);
}
void write(int x) {
  if (!x)
    putchar('0');
  else
    print(x);
  putchar('\n');
}
const int maxn = 1e6 + 10;
const int inf = 1e9;
const double eps = 1e-8;
const int mod = 1e9 + 7;
int n, t[maxn], sz[maxn], p[maxn], c;
int ask(int x, int i, int v) {
  write(1), write(x), write(i);
  for (int j = 1; j <= i; j++) printf("%d ", t[j]);
  puts("");
  write(v);
  fflush(stdout);
  int res;
  read(res);
  return res;
}
int cmp(int x, int y) { return sz[x] < sz[y]; }
struct edge {
  int a, b;
} e[maxn];
int tot;
int main() {
  read(n);
  for (int i = 1; i < n; i++) t[i] = i + 1, p[i] = i;
  p[n] = n;
  sz[1] = n;
  for (int i = 2; i <= n; i++) sz[i] = ask(1, n - 1, i);
  sort(p + 1, p + n + 1, cmp);
  for (int i = 1; sz[p[i]] == 1; i++) t[++c] = p[i];
  for (int i = c + 1; i <= n; i++) {
    int k = ask(1, c, p[i]);
    for (int pps = 1; pps <= k; pps++) {
      int l = 1, r = c, ans;
      while (l <= r) {
        int mid = (l + r) >> 1;
        if (!ask(1, mid, p[i]))
          l = mid + 1;
        else
          r = mid - 1, ans = mid;
      }
      e[++tot] = (edge){p[i], t[ans]};
      for (int i = ans; i < c; i++) t[i] = t[i + 1];
      c--;
    }
    t[++c] = p[i];
  }
  puts("ANSWER");
  for (int i = 1; i <= tot; i++) printf("%d %d\n", e[i].a, e[i].b);
  return 0;
}
