#include <bits/stdc++.h>
const int MAXN = 500 + 5;
int sz[MAXN], n;
inline int query(std::vector<int> v1, std::vector<int> v2, int v) {
  printf("%d\n", (int)v1.size());
  for (auto x : v1) printf("%d ", x);
  puts("");
  printf("%d\n", (int)v2.size());
  for (auto x : v2) printf("%d ", x);
  puts("");
  printf("%d\n", v);
  std::fflush(stdout);
  int res;
  scanf("%d", &res);
  return res;
}
int id[MAXN];
inline bool cmp(int x, int y) { return sz[x] < sz[y]; }
std::vector<int> S;
std::vector<std::pair<int, int> > ans;
inline int find(int x) {
  if (S.empty()) return -1;
  int l = 0, r = (int)S.size() - 1, ans = -1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    std::vector<int> v;
    for (int i = 0; i <= mid; ++i) v.push_back(S[i]);
    if (query({1}, v, x))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  if (ans != -1) {
    int res = S[ans];
    S.erase(S.begin() + ans);
    return res;
  }
  return -1;
}
int main() {
  scanf("%d", &n);
  sz[1] = n;
  std::vector<int> v;
  for (int i = 2; i <= n; ++i) v.push_back(i);
  for (int i = 2; i <= n; ++i) sz[i] = query({1}, v, i);
  std::iota(id + 1, id + n + 1, 1);
  std::sort(id + 1, id + n + 1, cmp);
  assert(id[n] == 1);
  for (int i = 1; i <= n - 1; ++i) {
    int t = -1;
    while ((t = find(id[i])) != -1) ans.push_back(std::make_pair(id[i], t));
    S.push_back(id[i]);
  }
  for (auto x : S) ans.push_back(std::make_pair(1, x));
  puts("ANSWER");
  for (auto x : ans) printf("%d %d\n", x.first, x.second);
  puts("");
  std::fflush(stdout);
  return 0;
}
