#include <bits/stdc++.h>
using namespace std;
int n;
int u = 1, v, a[505], len, ret, siz[505];
bool del[505];
void query() {
  if (len != 0) {
    printf("1\n1\n%d\n", len);
    for (int i = 1; i <= len; i++) printf("%d ", a[i]);
    printf("\n%d\n", v);
    fflush(stdout);
    scanf("%d", &ret);
  } else
    ret = 0;
}
vector<int> tmp;
inline bool cmp(const int &u, const int &v) { return siz[u] < siz[v]; }
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    v = i, len = 0;
    for (int j = 2; j <= n; j++) a[++len] = j;
    query();
    siz[i] = ret;
    tmp.push_back(i);
  }
  siz[1] = n;
  tmp.push_back(1);
  sort(tmp.begin(), tmp.end(), cmp);
  vector<pair<int, int> > ans;
  for (int i = 0; i < n; i++) {
    v = tmp[i];
    for (; siz[v] > 1; siz[v]--) {
      int L = 0, R = i - 1, mid;
      for (; L < R;) {
        mid = (L + R) >> 1, len = 0;
        for (int j = 0; j <= mid; j++)
          if (!del[j]) a[++len] = tmp[j];
        query();
        if (ret)
          R = mid;
        else
          L = mid + 1;
      }
      len = 0;
      for (int j = 0; j <= L; j++)
        if (!del[j]) a[++len] = tmp[j];
      query();
      if (ret) {
        ans.push_back(make_pair(tmp[L], tmp[i]));
        del[L] = 1;
      } else {
        break;
      }
    }
  }
  puts("ANSWER");
  for (int i = 0; i < n - 1; i++)
    printf("%d %d\n", ans[i].first, ans[i].second);
}
