#include <bits/stdc++.h>
using namespace std;
void printVec(vector<int> &v) {
  for (auto &p : v) cout << p << " ";
}
int ask(vector<int> &p, vector<int> &q) {
  cout << p.size() << " " << q.size() << " ";
  printVec(p);
  printVec(q);
  cout << endl;
  cout.flush();
  int d;
  cin >> d;
  if (d == -1) exit(0);
  return d;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int mx = -1e9;
    for (int i = 0; i < 9; ++i) {
      vector<int> a, b;
      for (int j = 0; j < n; ++j) {
        if ((j >> i) & 1)
          a.push_back(j + 1);
        else
          b.push_back(j + 1);
      }
      if (a.size() > 0 && b.size() > 0) mx = max(mx, ask(a, b));
    }
    cout << "-1 " << mx << endl;
  }
  return 0;
}
