#include <bits/stdc++.h>
using namespace std;
template <typename _T>
inline void _DBG(const char *s, _T x) {
  cerr << s << " = " << x << "\n";
}
template <typename _T, typename... args>
void _DBG(const char *s, _T x, args... a) {
  while (*s != ',') cerr << *s++;
  cerr << " = " << x << ',';
  _DBG(s + 1, a...);
}
int query(vector<int> S, vector<int> T, int v) {
  cout << (int)(S).size() << "\n";
  for (auto s : S) cout << s << " ";
  cout << "\n" << (int)(T).size() << "\n";
  for (auto t : T) cout << t << " ";
  cout << "\n" << v << "\n";
  cout.flush();
  int ans;
  cin >> ans;
  return ans;
}
const int N = 505;
int n;
pair<int, int> sz[N];
vector<pair<int, int> > edges;
int main() {
  cin >> n;
  vector<int> rest(n - 1);
  iota((rest).begin(), (rest).end(), 2);
  for (int i = 2; i <= n; i++) {
    sz[i].second = i;
    sz[i].first = query({1}, rest, i);
  }
  sort(sz + 2, sz + n + 1);
  vector<int> X;
  for (int i = 2; i <= n; i++) {
    int v = sz[i].second;
    while (true) {
      int l = -1, r = (int)(X).size();
      while (l + 1 < r) {
        int m = (l + r) / 2;
        vector<int> tmp(X.begin(), X.begin() + m + 1);
        if (query({1}, tmp, v) > 0) {
          r = m;
        } else {
          l = m;
        }
      }
      if (r == (int)(X).size()) {
        break;
      }
      edges.push_back({v, X[r]});
      swap(X[r], X.back());
      X.pop_back();
    }
    X.push_back(v);
  }
  for (auto x : X) {
    edges.push_back({1, x});
  }
  cout << "ANSWER\n";
  for (auto [a, b] : edges) {
    cout << a << " " << b << "\n";
  }
  cout.flush();
  return 0;
}
