#include <bits/stdc++.h>
#pragma GCC optimize("inline", "Ofast")
using namespace std;
template <class T>
inline void read(T &x) {
  int ch = 0, f = 0;
  x = 0;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = 1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - 48;
  if (f) x = -x;
}
const int N = 1005;
vector<int> S, T;
vector<pair<int, int> > Edge;
int sz[N], a[N], del[N], n;
inline int query(vector<int> S, vector<int> T, int x) {
  printf("%d\n", (int)S.size());
  for (int i = 0; i < (int)S.size(); i++) printf("%d ", S[i]);
  printf("\n%d\n", (int)T.size());
  for (int i = 0; i < (int)T.size(); i++) printf("%d ", T[i]);
  printf("\n%d\n", x);
  fflush(stdout);
  int ans = 0;
  return read(ans), ans;
}
inline bool cmp_size(int x, int y) { return sz[x] < sz[y]; }
inline int check(int mid, int x) {
  T.clear();
  for (int i = 1; i <= mid; i++)
    if (!del[i]) T.push_back(a[i]);
  if (!(int)T.size()) return 0;
  return query(S, T, x) > 0;
}
int main() {
  read(n);
  S.push_back(1);
  for (int i = 2; i <= n; i++) T.push_back(i);
  sz[1] = n;
  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_size);
  for (int i = 1; i < n; i++) {
    int u = a[i];
    if (sz[u] == 1) continue;
    while (1) {
      int l = 1, r = i - 1, pos = -1;
      while (l <= r) {
        int mid = (l + r) >> 1;
        if (check(mid, u))
          pos = mid, r = mid - 1;
        else
          l = mid + 1;
      }
      if (pos == -1) break;
      del[pos] = 1;
      Edge.push_back(make_pair(u, a[pos]));
    }
  }
  for (int i = 1; i < n; i++)
    if (!del[i]) Edge.push_back(make_pair(a[i], 1));
  puts("ANSWER");
  for (int i = 0; i < (int)Edge.size(); i++)
    printf("%d %d\n", Edge[i].first, Edge[i].second);
  fflush(stdout);
  return 0;
}
