#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int Tes = 1;
  cin >> Tes;
  int p[10];
  p[0] = 1;
  p[1] = 2;
  p[3] = 4;
  p[4] = 8;
  p[5] = 16;
  p[6] = 32;
  p[7] = 64;
  p[8] = 128;
  p[9] = 512;
  while (Tes--) {
    long long n, m;
    cin >> n;
    int x, y = 0;
    for (int pos = 0; pos <= 7; pos++) {
      vector<int> a, b;
      for (int i = 1; i <= n; i++) {
        int z = p[pos];
        int k = ((i) & (z));
        if (k > 0)
          a.push_back(i);
        else if (k == 0)
          b.push_back(i);
        if (k < 0) {
          cout << "HELL";
        }
      }
      if (a.empty() || b.empty()) break;
      cout << a.size() << ' ' << b.size() << ' ' << endl;
      for (auto i : a) cout << i << ' ';
      cout << endl;
      for (auto i : b) cout << i << ' ';
      cout << endl;
      a.clear();
      b.clear();
      cout.flush();
      cin >> x;
      y = max(x, y);
    }
    cout << -1 << "          " << y << endl;
  }
}
