#include <bits/stdc++.h>
using namespace std;
int t, n, ans, d;
vector<int> a, b;
int32_t main() {
  ios_base ::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cin >> t;
  while (t--) {
    cin >> n;
    ans = 0;
    for (int i = 0; i < 7; i++) {
      a.clear();
      b.clear();
      for (int j = 1; j <= n; j++) {
        if (j & (1 << i))
          a.push_back(j);
        else
          b.push_back(j);
      }
      if (!a.size() || !b.size()) continue;
      cout << a.size() << ' ' << b.size() << ' ';
      for (int i : a) cout << i << ' ';
      for (int i : b) cout << i << ' ';
      cout << endl;
      cin >> d;
      ans = max(ans, d);
    }
    cout << -1 << ' ' << ans << endl;
  }
}
