#include <bits/stdc++.h>
using namespace std;
template <typename T>
void chkmax(T &x, T y) {
  x = x > y ? x : y;
}
template <typename T>
void chkmin(T &x, T y) {
  x = x > y ? y : x;
}
template <typename T>
void add(T &x, T y, T mod) {
  x = x + y > mod ? x + y - mod : x + y;
}
template <typename T>
void sub(T &x, T y, T mod) {
  x = x - y < 0 ? x - y + mod : x - y;
}
template <typename T>
void multi(T &x, T y, T mod) {
  x = 1ll * x * y % mod;
}
const int INF = (1ll << 30);
template <typename T>
void read(T &x) {
  x = 0;
  bool f = 1;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = 0;
  } while (ch > '9' || ch < '0');
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  x = f ? x : -x;
}
template <typename T>
void write(T x) {
  if (x < 0) x = ~x + 1, putchar('-');
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
const int N = 500 + 5;
int n, ret, a[N], sz[N];
vector<int> S, T;
vector<pair<int, int> > G;
bool del[N];
inline int query(vector<int> s, vector<int> t, int u) {
  printf("%lu\n", s.size());
  for (int i = 0; i < s.size(); i++) printf("%d ", s[i]);
  puts("");
  printf("%lu\n", t.size());
  for (int i = 0; i < t.size(); i++) printf("%d ", t[i]);
  printf("\n%d\n", u);
  fflush(stdout);
  read(ret);
  fflush(stdout);
  return ret;
}
inline bool cmp(int a, int b) { return sz[a] < sz[b]; }
inline bool check(int r, int u) {
  S.clear();
  for (int i = 1; i <= r; i++)
    if (!del[i]) S.push_back(a[i]);
  if (!S.size()) return 0;
  return query(S, T, u) > 0;
}
int main() {
  read(n);
  sz[1] = n;
  for (int i = 2; i <= n; i++) S.push_back(i);
  T.push_back(1);
  for (int i = 2; i <= n; i++) sz[i] = query(S, T, i);
  for (int i = 1; i <= n; i++) a[i] = i;
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    int u = a[i];
    if (sz[u] == 1) continue;
    while (1) {
      int l = 1, r = i - 1, ans = -1;
      while (l <= r) {
        int mid = (l + r) >> 1;
        if (check(mid, u))
          ans = mid, r = mid - 1;
        else
          l = mid + 1;
      }
      if (ans == -1) break;
      del[ans] = true;
      G.push_back(make_pair(a[ans], u));
    }
  }
  for (int i = 1; i < n; i++)
    if (!del[i]) G.push_back(make_pair(a[i], 1));
  puts("ANSWER");
  for (int i = 0; i < n; i++) printf("%d %d\n", G[i].first, G[i].second);
  fflush(stdout);
  return 0;
}
