// end of patience
#include<bits/stdc++.h>
using namespace std ;
#define int long long int
#define F first
#define S second
#define pb push_back
int a[20][10005] , adj[20][20] , adj1[20][20] ;
int dp[20][20][1<<16] , n , m ;
int brute( int pos , int mask , int ind , int val )
{
    if( (1<<n) - 1 == mask )
    {
        return min( val , adj1[pos][ind] ) ;
    }
    if( dp[ind][pos][mask] != -1 )
        return dp[ind][pos][mask] ;
    int cnt = 0 ;
    for( int i = 0 ; i < n ; i++ )
    {
        if( ( mask & ( 1 << i ) ) )
        continue ;
        cnt = max( cnt , min( val , brute( i , mask|(1<<i) , ind , adj[pos][i] ) ) ) ;
    }
    dp[ind][pos][mask] = cnt ;
    return cnt ;
}
signed main()
{
    ios_base::sync_with_stdio(false) ;
    cin.tie(0) ; cout.tie(0) ;
    cin >> n >> m ;
    for( int i = 0 ; i < n ; i++ )
    {
        for( int j = 0 ; j < m ; j++ )
            cin >> a[i][j] ;
    }
    for( int i = 0 ; i < n ; i++ )
    {
        for( int j = 0 ; j < n ; j++ )
        {
            int x = INT_MAX , xx = INT_MAX ;
            for( int k = 0 ; k < m ; k++ )
            {
                x = min( x , abs( a[i][k] - a[j][k] ) ) ;
                if( k < m - 1 )
                    xx = min( xx , abs( a[j][k] - a[i][k+1] ) ) ;
            }
            adj[i][j] = x ;
            adj1[i][j] = xx ;
        }
    }
    if( n == 1 )
        return cout << adj1[0][0] , 0 ;
    memset( dp , -1 , sizeof(dp ) ) ;
    int ans = 0 ;
    for( int i = 0 ; i < n ; i++ )
        ans = max( ans , brute( i , 1<<i , i , INT_MAX ) ) ;
    cout << ans ;
    cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
}


// end of patience
#include<bits/stdc++.h>
using namespace std ;
#define int long long int
#define F first
#define S second
#define pb push_back
int a[20][10005] , adj[20][20] , adj1[20][20] ;
int dp[20][1<<16] , n , m ;
int brute( int pos , int id , int mask , int k , int ind )
{
    if( pos == n - 1 )
    {
        for( int i = 0 ; i < n ; i++ )
        {
            if( ( mask & ( 1 << i ) ) == 0 )
            {
                int x = INT_MAX ;
                for( int j = 1 ; j < m ; j++ )
                    x = min( x , abs( a[ind][j] - a[i][j-1] ) ) ;
                x = min( x , adj[id][i] ) ;
                if( x < k )
                    return 0 ;
                return 1 ;
            }
        }
    }
    //if( dp[id][mask] != -1 )
    //    return dp[id][mask] ;
    int cnt = 0 ;
    for( int i = 0 ; i < n ; i++ )
    {
        if( ( mask & ( 1 << i ) ) == 0 && adj[id][i] >= k )
            cnt = max( cnt , brute( pos + 1 , i , mask|(1<<i) , k , ind ) ) ;
    }
    dp[id][mask] = cnt ;
    return cnt ;
}
signed main()
{
    ios_base::sync_with_stdio(false) ;
    cin.tie(0) ; cout.tie(0) ;
    cin >> n >> m ;
    for( int i = 0 ; i < n ; i++ )
    {
        for( int j = 0 ; j < m ; j++ )
            cin >> a[i][j] ;
    }
    for( int i = 0 ; i < n ; i++ )
    {
        for( int j = 0 ; j < n ; j++ )
        {
            int x = INT_MAX , xx = INT_MAX ;
            for( int k = 0 ; k < m ; k++ )
            {
                x = min( x , abs( a[i][k] - a[j][k] ) ) ;
                if( k < m - 1 )
                    xx = min( xx , abs( a[j][k] - a[i][k+1] ) ) ;
            }
            adj[i][j] = x ;
            adj1[i][j] = xx ;
        }
    }
    if( n == 1 )
        return cout << adj1[0][0] , 0 ;
    int lo = 0 , hi = 1e10 ;
    int ans = 0 ;
    while( lo <= hi )
    {
        int mid = ( lo + hi ) / 2 ;
        memset( dp , -1 , sizeof( dp ) ) ;
        int p = 0 ;
        for( int i = 0 ; i < n ; i++ )
            p = max( p , brute( 1 , i , (1<<i) , mid , i ) ) ;
        if( p )
            lo = mid + 1 , ans = mid ;
        else
            hi = mid - 1 ;
    }
    cout << ans ;
    cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
}


#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int,int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vll>;
using vb = vector<bool>;

const int INF = 2e9+5;
const ll LLINF = (1LL << 60) + 5;

/*
  filippos
  Contest : 1102
  Task : F
*/

int main(){
  cin.tie(0), cin.sync_with_stdio(0), cout.tie(0), cout.sync_with_stdio(0);

  int n, m; cin >> n >> m;
  vvi v(n, vi(m));
  for(auto &x : v)
    for(auto &i : x)
      cin >> i;

  function<bool(int)> solve = [&](int k){
    // g[i][j] = g[j][i] = can they be one after the other
    vvi g(n, vi(n, 1));
    for(int c = 0; c < m; c++)
      for(int i = 0; i < n; i++)
        for(int j = i + 1; j < n; j++)
          if(abs(v[i][c] - v[j][c]) < k)
            g[i][j] = g[j][i] = 0;

    // start[i][j] = can we end in j if we start in i
    vvi start(n, vi(n, 1));
    for(int c = 0; c + 1 < m; c++)
      for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
          if(abs(v[i][c] - v[j][c+1]) < k){
            start[j][i] = 0;
          }

    function<bool(int)> tsp = [&](int from){
      vvi memo(n, vi(1 << n, -1));
      // if you win from i, given mask
      function<int(int, int)> dp = [&](int i, int mask){
        // check dp
        int &ans = memo[i][mask];
        if(ans != -1) return ans;
        // if we arrived
        if(mask == (1 << n) - 1){
          return ans = (start[from][i] || start[i][from]);
        }
        // try all edges
        ans = 0;
        for(int j = 0; j < g[i].size(); j++) if(g[i][j]) {
          if((mask & (1 << j)) == 0) {
            if(dp(j, mask | (1 << j)))
              return ans = 1;
          }
        }
        return ans = 0;
      };

      int sol = dp(from, 1<<from);
      return sol;
    };

    for(int i = 0; i < n; i++){
      if(tsp(i)) return 1;
    }
    return 0;
  };

  int l = 0, r = 1e9;
  while(l != r){
    int m = (l+r) / 2 + 1;
    if(solve(m))
      l = m;
    else
      r = m-1;
  }

  cout << l << '\n';

}


#include <bits/stdc++.h>
#include <climits>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define si(x) int x = scanInt();
#define sll(x) LL x = scanLong();
#define sci(x) int x; scanf("%d", &x);
#define scll(x) LL x; scanf("%lld", &x);
#define pi(x) printf("%d ", x)
#define pll(x) printf("%lld ", x)
#define nl printf("\n")
#define clr(a) memset(a, 0, sizeof(a))
#define PB push_back
#define MP make_pair
using namespace std;
typedef unsigned int UI; // 32 bit integer
typedef long int LI; // 32 bit integer
typedef unsigned long int ULI; // 32 bit unsigned integer
typedef long long int LL; // 64 bit integer
typedef unsigned long long int  ULL; // 64 bit unsigned integer
typedef long double LD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const LL MOD = 1e9+7;

/* Fast I/O */
inline int scanInt() {
	int n = 0;
	char ch = getchar();
	int sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(int)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

inline LL scanLong() {
	LL n = 0;
	char ch = getchar();
	LL sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(LL)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

LL query(LL src, PLL range) {
	cout << 1 << " " << (range.second - range.first + 1) << " " << src << " ";
	rep(i, range.first, range.second+1)	cout << i << " ";
	cout << endl;
	cout.flush();
	LL ans; cin >> ans;
	if(ans == -1)	exit();
	return ans;
}

void solve() {
	LL n; cin >> n;
	LL lo = 2, hi = n, dist = query(1, MP(2, n));
	while(lo < hi) {
		pll(lo); pll(hi); nl;
		LL mid = (lo+hi)>>1;
		LL newdist = query(1, MP(lo, mid));
		if(newdist < dist)	lo = mid+1;
		else	hi = mid;
	}
	cout << 1 << " " << (n-1) << " " << lo << " ";
	rep(i, 1, n+1)	if(i != lo)	cout << i << " ";
	cout << endl;
	cout.flush();
	LL ans; cin >> ans;
	if(ans == -1)	exit();
	cout << -1 << " " << ans << endl;
	cout.flush();
}

int main() {
	LL t; cin >> t;
	rep(_, 0, t)	solve();
}


#include <bits/stdc++.h>
#include <climits>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define si(x) int x = scanInt();
#define sll(x) LL x = scanLong();
#define sci(x) int x; scanf("%d", &x);
#define scll(x) LL x; scanf("%lld", &x);
#define pi(x) printf("%d ", x)
#define pll(x) printf("%lld ", x)
#define nl printf("\n")
#define clr(a) memset(a, 0, sizeof(a))
#define PB push_back
#define MP make_pair
using namespace std;
typedef unsigned int UI; // 32 bit integer
typedef long int LI; // 32 bit integer
typedef unsigned long int ULI; // 32 bit unsigned integer
typedef long long int LL; // 64 bit integer
typedef unsigned long long int  ULL; // 64 bit unsigned integer
typedef long double LD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const LL MOD = 1e9+7;

/* Fast I/O */
inline int scanInt() {
	int n = 0;
	char ch = getchar();
	int sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(int)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

inline LL scanLong() {
	LL n = 0;
	char ch = getchar();
	LL sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(LL)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

LL query(LL src, PLL range) {
	cout << 1 << " " << (range.second - range.first + 1) << " " << src << " ";
	rep(i, range.first, range.second+1)	cout << i << " ";
	cout << endl;
	cout.flush();
	LL ans; cin >> ans;
	if(ans == -1)	exit(0);
	return ans;
}

void solve() {
	LL n; cin >> n;
	LL lo = 2, hi = n, dist = query(1, MP(2, n));
	while(lo < hi) {
		pll(lo); pll(hi); nl;
		LL mid = (lo+hi)>>1;
		LL newdist = query(1, MP(lo, mid));
		if(newdist < dist)	lo = mid+1;
		else	hi = mid;
	}
	LL ans;
	if(n != 2) {
		cout << 1 << " " << (n-1) << " " << lo << " ";
		rep(i, 1, n+1)	if(i != lo)	cout << i << " ";
		cout << endl;
		cout.flush();
		cin >> ans;
	} else ans = dist;
	if(ans == -1)	exit(0);
	cout << -1 << " " << ans << endl;
	cout.flush();
}

int main() {
	LL t; cin >> t;
	rep(_, 0, t)	solve();
}


#include <bits/stdc++.h>
#include <climits>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define si(x) int x = scanInt();
#define sll(x) LL x = scanLong();
#define sci(x) int x; scanf("%d", &x);
#define scll(x) LL x; scanf("%lld", &x);
#define pi(x) printf("%d ", x)
#define pll(x) printf("%lld ", x)
#define nl printf("\n")
#define clr(a) memset(a, 0, sizeof(a))
#define PB push_back
#define MP make_pair
using namespace std;
typedef unsigned int UI; // 32 bit integer
typedef long int LI; // 32 bit integer
typedef unsigned long int ULI; // 32 bit unsigned integer
typedef long long int LL; // 64 bit integer
typedef unsigned long long int  ULL; // 64 bit unsigned integer
typedef long double LD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const LL MOD = 1e9+7;

/* Fast I/O */
inline int scanInt() {
	int n = 0;
	char ch = getchar();
	int sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(int)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

inline LL scanLong() {
	LL n = 0;
	char ch = getchar();
	LL sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(LL)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

void solve() {
	LL n; cin >> n;
	LL ans = 0;
	rep(b, 0, 8) {
		VLL v1, v2;
		rep(i, 0, n) {
			if((i >> b) & 1)	v1.PB(i+1);
			else	v2.PB(i+1);
		}
		if(v1.empty() || v2.empty())	continue;
		cout << v1.size() << " " << v2.size() << " ";
		rep(it, v1.begin(), v1.end())	cout << *it << " ";
		rep(it, v2.begin(), v2.end())	cout << *it << " ";
		cout << endl;
		cout.flush();
		LL foo; cin >> foo;
		ans = max(ans, foo);
	}
	cout << -1 << " " << ans << endl;
}

int main() {
	LL t; cin >> t;
	rep(_, 0, t)	solve();
}


#include <bits/stdc++.h>
#include <climits>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define si(x) int x = scanInt();
#define sll(x) LL x = scanLong();
#define sci(x) int x; scanf("%d", &x);
#define scll(x) LL x; scanf("%lld", &x);
#define pi(x) printf("%d ", x)
#define pll(x) printf("%lld ", x)
#define nl printf("\n")
#define clr(a) memset(a, 0, sizeof(a))
#define PB push_back
#define MP make_pair
using namespace std;
typedef unsigned int UI; // 32 bit integer
typedef long int LI; // 32 bit integer
typedef unsigned long int ULI; // 32 bit unsigned integer
typedef long long int LL; // 64 bit integer
typedef unsigned long long int  ULL; // 64 bit unsigned integer
typedef long double LD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const LL MOD = 1e9+7;

/* Fast I/O */
inline int scanInt() {
	int n = 0;
	char ch = getchar();
	int sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(int)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

inline LL scanLong() {
	LL n = 0;
	char ch = getchar();
	LL sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(LL)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

LL query(LL src, PLL range) {
	cout << 1 << " " << (range.second - range.first + 1) << " " << src << " ";
	rep(i, range.first, range.second+1)	cout << i << " ";
	cout << endl;
	cout.flush();
	LL ans; cin >> ans;
	return ans;
}

void solve() {
	LL n; cin >> n;
	LL lo = 2, hi = n, dist = query(1, MP(2, n));
	while(lo < hi) {
		pll(lo); pll(hi); nl;
		LL mid = (lo+hi)>>1;
		LL newdist = query(1, MP(lo, mid));
		if(newdist < dist)	lo = mid+1;
		else	hi = mid;
	}
	cout << 1 << " " << (n-1) < " " << lo << " ";
	rep(i, 1, n+1)	if(i != lo)	cout << i << " ";
	cout << endl;
	cout.flush();
	LL ans; cin >> ans;
	cout << -1 << " " << ans << endl;
	cout.flush();
}

int main() {
	LL t; cin >> t;
	rep(_, 0, t)	solve();
}


// Problem : C. Tree Diameter
// Contest : Codeforces - Forethought Future Cup - Elimination Round
// URL : https://codeforces.com/contest/1146/problem/C
// Memory Limit : 256 MB
// Time Limit : 4000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//look at my code
//my code is amazing
#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll long long
#define int long long
#define mod 1000000007 //998244353
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define nl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define cout1(a) cout<<a<<nl
#define cout2(a,b) cout<<a<<" "<<b<<nl
#define cout3(a,b,c) cout<<a<<" "<<b<<" "<<c<<nl
#define cout4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<nl
#define vcout(v,i) cout<<v[i].fi<<" "<<v[i].se<<nl
#define x first
#define y second
#define vc vector
#define pb push_back
#define ar array
#define all(a) (a).begin(), (a).end()
#define ms(v,n,x) fill(v,v+n,x);
#define init(c,a) memset(c,a,sizeof(c))
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define maxi(a,b,c) max(a,max(b,c))
#define maxii(a,b,c,d) max(max(a,b),max(c,d))
#define mini(a,b,c) min(a,min(b,c))
#define md(a,b)  ((a%mod)*(b%mod)+mod)%mod
#define inf 9e18
#define cases ll T;cin>>T;while(T--)
#define BLOCK 500
//const double PI = 3.141592653589793238460;
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
// void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// const int N=;
ll query(vll ask1,vll ask2){
	cout<<ask1.size()<<" ";
	for(auto i:ask1)
	cout<<i<<" ";
	cout<<ask2.size()<<" ";
	for(auto i:ask2)
	cout<<i<<" ";
	cout<<endl;
	ll x;
	cin>>x;
	return x;

}
int32_t main()
{

	fast
	cases{
		ll n;
		cin>>n;
		vll ask1,ask2,ask3,ask;
		ask1.pb(1);
		for(ll i=2;i<=n;i++)
		ask2.pb(i);
		ll x=query(ask1,ask2);
		for(ll l=2;l<=n;l++)
		ask.pb(l);
		ll an=2;
		f(i,7){

			if(ask.size()==1){
			an=ask[0];
			break;
			}
			ask2.clear();
			ask3.clear();
			for(ll i:ask){
				if(i&1)
				ask2.pb(i);
				else
				ask3.pb(i);
			}
			if(ask2.size()==0)
			{
				an=ask3[0];
				break;
			}
			ll p=query(ask1,ask2);

			if(p!=x){
				ask=ask3;
			}
			else{
				ask=ask2;
			}
			// debug(l,h,m,p);

		}

		ask1.clear();
		ask2.clear();
		ask1.pb(an);
		for(ll i=1;i<=n;i++)
		if(i!=an)
		ask2.pb(i);
		// debug(l);

		ll ans=query(ask1,ask2);
		cout<<"-1 "<<ans<<endl;
	}

	return 0;

}


// Problem : C. Tree Diameter
// Contest : Codeforces - Forethought Future Cup - Elimination Round
// URL : https://codeforces.com/contest/1146/problem/C
// Memory Limit : 256 MB
// Time Limit : 4000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//look at my code
//my code is amazing
#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll long long
#define int long long
#define mod 1000000007 //998244353
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define nl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define cout1(a) cout<<a<<nl
#define cout2(a,b) cout<<a<<" "<<b<<nl
#define cout3(a,b,c) cout<<a<<" "<<b<<" "<<c<<nl
#define cout4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<nl
#define vcout(v,i) cout<<v[i].fi<<" "<<v[i].se<<nl
#define x first
#define y second
#define vc vector
#define pb push_back
#define ar array
#define all(a) (a).begin(), (a).end()
#define ms(v,n,x) fill(v,v+n,x);
#define init(c,a) memset(c,a,sizeof(c))
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define maxi(a,b,c) max(a,max(b,c))
#define maxii(a,b,c,d) max(max(a,b),max(c,d))
#define mini(a,b,c) min(a,min(b,c))
#define md(a,b)  ((a%mod)*(b%mod)+mod)%mod
#define inf 9e18
#define cases ll T;cin>>T;while(T--)
#define BLOCK 500
//const double PI = 3.141592653589793238460;
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
// void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// const int N=;
ll query(vll ask1,vll ask2){
	cout<<ask1.size()<<" ";
	for(auto i:ask1)
	cout<<i<<" ";
	cout<<ask2.size()<<" ";
	for(auto i:ask2)
	cout<<i<<" ";
	cout<<endl;
	ll x;
	cin>>x;
	return x;

}
int32_t main()
{

	fast
	cases{
		ll n;
		cin>>n;
		vll ask1,ask2;
		ask1.pb(1);
		for(ll i=2;i<=n;i++)
		ask2.pb(i);
		ll x=query(ask1,ask2);
		ll l=2,h=n,an=1;
		while(l<=h){
			ask2.clear();
			ll m=(l+h)>>1;
			for(ll i=2;i<=m;i++){
				ask2.pb(i);
			}
			ll p=query(ask1,ask2);
			if(p!=x){
				l=m+1;
			}
			else{
				an=m;
				h=m-1;
			}
			// debug(l,h,m,p);

		}
		l=an;
		ask1.clear();
		ask2.clear();
		ask1.pb(l);
		for(ll i=1;i<=n;i++)
		if(i!=l)
		ask2.pb(i);
		// debug(l);

		ll ans=query(ask1,ask2);
		cout<<"-1 "<<ans<<endl;
	}

	return 0;

}


// Problem : C. Tree Diameter
// Contest : Codeforces - Forethought Future Cup - Elimination Round
// URL : https://codeforces.com/contest/1146/problem/C
// Memory Limit : 256 MB
// Time Limit : 4000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//look at my code
//my code is amazing
#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll long long
#define int long long
#define mod 1000000007 //998244353
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define nl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define cout1(a) cout<<a<<nl
#define cout2(a,b) cout<<a<<" "<<b<<nl
#define cout3(a,b,c) cout<<a<<" "<<b<<" "<<c<<nl
#define cout4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<nl
#define vcout(v,i) cout<<v[i].fi<<" "<<v[i].se<<nl
#define x first
#define y second
#define vc vector
#define pb push_back
#define ar array
#define all(a) (a).begin(), (a).end()
#define ms(v,n,x) fill(v,v+n,x);
#define init(c,a) memset(c,a,sizeof(c))
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define maxi(a,b,c) max(a,max(b,c))
#define maxii(a,b,c,d) max(max(a,b),max(c,d))
#define mini(a,b,c) min(a,min(b,c))
#define md(a,b)  ((a%mod)*(b%mod)+mod)%mod
#define inf 9e18
#define cases ll T;cin>>T;while(T--)
#define BLOCK 500
//const double PI = 3.141592653589793238460;
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
// void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// const int N=;
ll query(vll ask1,vll ask2){
	cout<<ask1.size()<<" "<<ask2.size()<<" ";
	for(auto i:ask1)
	cout<<i<<" ";

	for(auto i:ask2)
	cout<<i<<" ";
	cout<<endl;
	ll x;
	cin>>x;
	return x;

}
int32_t main()
{

	fast
	cases{
		ll n;
		cin>>n;
		vll ask1,ask2,ask3,ask;
		ask1.pb(1);
		for(ll i=2;i<=n;i++)
		ask2.pb(i);
		ll x=query(ask1,ask2);
		for(ll l=2;l<=n;l++)
		ask.pb(l);
		ll an=2;
		f(i,7){

			if(ask.size()==1){
			an=ask[0];
			break;
			}
			ask2.clear();
			ask3.clear();
			ll m=0;
			for(ll i:ask){
				if(!m&1)
				ask2.pb(i);
				else
				ask3.pb(i);
				m++;
			}
			if(ask2.size()==0)
			{
				an=ask3[0];
				break;
			}
			ll p=query(ask1,ask2);

			if(p!=x){
				ask=ask3;
			}
			else{
				ask=ask2;
			}
			// debug(l,h,m,p);

		}

		ask1.clear();
		ask2.clear();
		ask1.pb(an);
		for(ll i=1;i<=n;i++)
		if(i!=an)
		ask2.pb(i);
		// debug(l);

		ll ans=query(ask1,ask2);
		cout<<"-1 "<<ans<<endl;
	}

	return 0;

}


// Problem : C. Tree Diameter
// Contest : Codeforces - Forethought Future Cup - Elimination Round
// URL : https://codeforces.com/contest/1146/problem/C
// Memory Limit : 256 MB
// Time Limit : 4000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//look at my code
//my code is amazing
#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll long long
#define int long long
#define mod 1000000007 //998244353
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define nl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define cout1(a) cout<<a<<nl
#define cout2(a,b) cout<<a<<" "<<b<<nl
#define cout3(a,b,c) cout<<a<<" "<<b<<" "<<c<<nl
#define cout4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<nl
#define vcout(v,i) cout<<v[i].fi<<" "<<v[i].se<<nl
#define x first
#define y second
#define vc vector
#define pb push_back
#define ar array
#define all(a) (a).begin(), (a).end()
#define ms(v,n,x) fill(v,v+n,x);
#define init(c,a) memset(c,a,sizeof(c))
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define maxi(a,b,c) max(a,max(b,c))
#define maxii(a,b,c,d) max(max(a,b),max(c,d))
#define mini(a,b,c) min(a,min(b,c))
#define md(a,b)  ((a%mod)*(b%mod)+mod)%mod
#define inf 9e18
#define cases ll T;cin>>T;while(T--)
#define BLOCK 500
//const double PI = 3.141592653589793238460;
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
// void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// const int N=;
ll query(vll ask1,vll ask2){
	cout<<ask1.size()<<" ";
	for(auto i:ask1)
	cout<<i<<" ";
	cout<<ask2.size()<<" ";
	for(auto i:ask2)
	cout<<i<<" ";
	cout<<endl;
	ll x;
	cin>>x;
	return x;

}
int32_t main()
{

	fast
	cases{
		ll n;
		cin>>n;
		vll ask1,ask2;
		ask1.pb(1);
		for(ll i=2;i<=n;i++)
		ask2.pb(i);
		ll x=query(ask1,ask2);
		ll l=2,h=n,an=1;
		while(l<=h){
			ask2.clear();
			ll m=(l+h)>>1;
			for(ll i=2;i<=m;i++){
				ask2.pb(i);
			}
			ll p=query(ask1,ask2);
			if(p!=x){
				l=m+1;
			}
			else{
				an=h;
				h=m-1;
			}
			// debug(l,h,m,p);

		}
		l=an;
		ask1.clear();
		ask2.clear();
		ask1.pb(l);
		for(ll i=1;i<=n;i++)
		if(i!=l)
		ask2.pb(i);
		// debug(l);

		ll ans=query(ask1,ask2);
		cout<<"-1 "<<ans<<endl;
	}

	return 0;

}


// Problem : C. Tree Diameter
// Contest : Codeforces - Forethought Future Cup - Elimination Round
// URL : https://codeforces.com/contest/1146/problem/C
// Memory Limit : 256 MB
// Time Limit : 4000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//look at my code
//my code is amazing
#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll long long
#define int long long
#define mod 1000000007 //998244353
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define nl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define cout1(a) cout<<a<<nl
#define cout2(a,b) cout<<a<<" "<<b<<nl
#define cout3(a,b,c) cout<<a<<" "<<b<<" "<<c<<nl
#define cout4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<nl
#define vcout(v,i) cout<<v[i].fi<<" "<<v[i].se<<nl
#define x first
#define y second
#define vc vector
#define pb push_back
#define ar array
#define all(a) (a).begin(), (a).end()
#define ms(v,n,x) fill(v,v+n,x);
#define init(c,a) memset(c,a,sizeof(c))
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define maxi(a,b,c) max(a,max(b,c))
#define maxii(a,b,c,d) max(max(a,b),max(c,d))
#define mini(a,b,c) min(a,min(b,c))
#define md(a,b)  ((a%mod)*(b%mod)+mod)%mod
#define inf 9e18
#define cases ll T;cin>>T;while(T--)
#define BLOCK 500
//const double PI = 3.141592653589793238460;
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
// void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// const int N=;
ll query(vll ask1,vll ask2){
	cout<<ask1.size()<<" ";
	for(auto i:ask1)
	cout<<i<<" ";
	cout<<ask2.size()<<" ";
	for(auto i:ask2)
	cout<<i<<" ";
	cout<<endl;
	ll x;
	cin>>x;
	return x;

}
int32_t main()
{

	fast
	cases{
		ll n;
		cin>>n;
		vll ask1,ask2;
		ask1.pb(1);
		for(ll i=2;i<=n;i++)
		ask2.pb(i);
		ll x=query(ask1,ask2);
		ll l=2,h=n;
		while(l<=h){
			ask2.clear();
			ll m=(l+h)>>1;
			for(ll i=2;i<=m;i++){
				ask2.pb(i);
			}
			ll p=query(ask1,ask2);
			if(p!=x){
				l=m+1;
			}
			else{
				h=m-1;
			}
			// debug(l,h,m,p);

		}

		ask1.clear();
		ask2.clear();
		ask1.pb(l);
		for(ll i=1;i<=n;i++)
		if(i!=l)
		ask2.pb(i);
		// debug(l);

		ll ans=query(ask1,ask2);
		cout<<"-1 "<<ans<<endl;
	}

	return 0;

}


// Problem : C. Tree Diameter
// Contest : Codeforces - Forethought Future Cup - Elimination Round
// URL : https://codeforces.com/contest/1146/problem/C
// Memory Limit : 256 MB
// Time Limit : 4000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//look at my code
//my code is amazing
#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll long long
#define int long long
#define mod 1000000007 //998244353
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define nl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define cout1(a) cout<<a<<nl
#define cout2(a,b) cout<<a<<" "<<b<<nl
#define cout3(a,b,c) cout<<a<<" "<<b<<" "<<c<<nl
#define cout4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<nl
#define vcout(v,i) cout<<v[i].fi<<" "<<v[i].se<<nl
#define x first
#define y second
#define vc vector
#define pb push_back
#define ar array
#define all(a) (a).begin(), (a).end()
#define ms(v,n,x) fill(v,v+n,x);
#define init(c,a) memset(c,a,sizeof(c))
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define maxi(a,b,c) max(a,max(b,c))
#define maxii(a,b,c,d) max(max(a,b),max(c,d))
#define mini(a,b,c) min(a,min(b,c))
#define md(a,b)  ((a%mod)*(b%mod)+mod)%mod
#define inf 9e18
#define cases ll T;cin>>T;while(T--)
#define BLOCK 500
//const double PI = 3.141592653589793238460;
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
// void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// const int N=;
ll query(vll ask1,vll ask2){
	cout<<ask1.size()<<" ";
	for(auto i:ask1)
	cout<<i<<" ";
	cout<<ask2.size()<<" ";
	for(auto i:ask2)
	cout<<i<<" ";
	cout<<endl;
	ll x;
	cin>>x;
	return x;

}
int32_t main()
{

	fast
	cases{
		ll n;
		cin>>n;
		vll ask1,ask2;
		ask1.pb(1);
		for(ll i=2;i<=n;i++)
		ask2.pb(i);
		ll x=query(ask1,ask2);
		ll l=2,h=n;
		while(l<h){
			ask2.clear();
			ll m=(l+h)>>1;
			for(ll i=2;i<=m;i++){
				ask2.pb(i);
			}
			ll p=query(ask1,ask2);
			if(p!=x){
				l=m+1;
			}
			else{
				h=m;
			}
			// debug(l,h,m,p);

		}

		ask1.clear();
		ask2.clear();
		ask1.pb(l);
		for(ll i=1;i<=n;i++)
		if(i!=l)
		ask2.pb(i);
		// debug(l);

		ll ans=query(ask1,ask2);
		cout<<"-1 "<<ans<<endl;
	}

	return 0;

}


// Problem : C. Tree Diameter
// Contest : Codeforces - Forethought Future Cup - Elimination Round
// URL : https://codeforces.com/contest/1146/problem/C
// Memory Limit : 256 MB
// Time Limit : 4000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//look at my code
//my code is amazing
#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll long long
#define int long long
#define mod 1000000007 //998244353
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define nl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define cout1(a) cout<<a<<nl
#define cout2(a,b) cout<<a<<" "<<b<<nl
#define cout3(a,b,c) cout<<a<<" "<<b<<" "<<c<<nl
#define cout4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<nl
#define vcout(v,i) cout<<v[i].fi<<" "<<v[i].se<<nl
#define x first
#define y second
#define vc vector
#define pb push_back
#define ar array
#define all(a) (a).begin(), (a).end()
#define ms(v,n,x) fill(v,v+n,x);
#define init(c,a) memset(c,a,sizeof(c))
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define maxi(a,b,c) max(a,max(b,c))
#define maxii(a,b,c,d) max(max(a,b),max(c,d))
#define mini(a,b,c) min(a,min(b,c))
#define md(a,b)  ((a%mod)*(b%mod)+mod)%mod
#define inf 9e18
#define cases ll T;cin>>T;while(T--)
#define BLOCK 500
//const double PI = 3.141592653589793238460;
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
// void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// const int N=;
ll query(vll ask1,vll ask2){
	cout<<ask1.size()<<" "<<ask2.size()<<" ";
	for(auto i:ask1)
	cout<<i<<" ";

	for(auto i:ask2)
	cout<<i<<" ";
	cout<<endl;
	ll x;
	cin>>x;
	return x;

}
int32_t main()
{

	fast
	cases{
		ll n;
		cin>>n;
		vll ask1,ask2,ask3,ask;
		ask1.pb(1);
		for(ll i=2;i<=n;i++)
		ask2.pb(i);
		ll x=query(ask1,ask2);
		for(ll l=2;l<=n;l++)
		ask.pb(l);
		ll an=2;
		f(i,7){

			if(ask.size()==1){
			an=ask[0];
			break;
			}
			ask2.clear();
			ask3.clear();
			for(ll i:ask){
				if(i&1)
				ask2.pb(i);
				else
				ask3.pb(i);
			}
			if(ask2.size()==0)
			{
				an=ask3[0];
				break;
			}
			ll p=query(ask1,ask2);

			if(p!=x){
				ask=ask3;
			}
			else{
				ask=ask2;
			}
			// debug(l,h,m,p);

		}

		ask1.clear();
		ask2.clear();
		ask1.pb(an);
		for(ll i=1;i<=n;i++)
		if(i!=an)
		ask2.pb(i);
		// debug(l);

		ll ans=query(ask1,ask2);
		cout<<"-1 "<<ans<<endl;
	}

	return 0;

}


// Problem : C. Tree Diameter
// Contest : Codeforces - Forethought Future Cup - Elimination Round
// URL : https://codeforces.com/contest/1146/problem/C
// Memory Limit : 256 MB
// Time Limit : 4000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//look at my code
//my code is amazing
#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll long long
#define int long long
#define mod 1000000007 //998244353
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define nl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define cout1(a) cout<<a<<nl
#define cout2(a,b) cout<<a<<" "<<b<<nl
#define cout3(a,b,c) cout<<a<<" "<<b<<" "<<c<<nl
#define cout4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<nl
#define vcout(v,i) cout<<v[i].fi<<" "<<v[i].se<<nl
#define x first
#define y second
#define vc vector
#define pb push_back
#define ar array
#define all(a) (a).begin(), (a).end()
#define ms(v,n,x) fill(v,v+n,x);
#define init(c,a) memset(c,a,sizeof(c))
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define maxi(a,b,c) max(a,max(b,c))
#define maxii(a,b,c,d) max(max(a,b),max(c,d))
#define mini(a,b,c) min(a,min(b,c))
#define md(a,b)  ((a%mod)*(b%mod)+mod)%mod
#define inf 9e18
#define cases ll T;cin>>T;while(T--)
#define BLOCK 500
//const double PI = 3.141592653589793238460;
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
// void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// const int N=;
ll query(vll ask1,vll ask2){
	cout<<ask1.size()<<" "<<ask2.size()<<" ";
	for(auto i:ask1)
	cout<<i<<" ";

	for(auto i:ask2)
	cout<<i<<" ";
	cout<<endl;
	ll x;
	cin>>x;
	return x;

}
int32_t main()
{

	fast
	cases{
		ll n;
		cin>>n;
		vll ask1,ask2,ask3,ask;
		ask1.pb(1);
		for(ll i=2;i<=n;i++)
		ask2.pb(i);
		ll x=query(ask1,ask2);
		for(ll l=2;l<=n;l++)
		ask.pb(l);

		while((ll)ask.size()>1){

			ask2.clear();
			ask3.clear();
			ll m=0;
			for(ll i:ask){
				if(!(m&1))
				ask2.pb(i);
				else
				ask3.pb(i);
				m++;
			}

			ll p=query(ask1,ask2);

			if(p!=x){
				ask=ask3;
			}
			else{
				ask=ask2;
			}
			// debug(l,h,m,p);

		}

		ask1.clear();
		ask2.clear();
		ask1.pb(ask[0]);
		for(ll i=1;i<=n;i++)
		if(i!=ask[0])
		ask2.pb(i);
		// debug(l);

		ll ans=query(ask1,ask2);
		cout<<"-1 "<<ans<<endl;
	}

	return 0;

}


// Problem : C. Tree Diameter
// Contest : Codeforces - Forethought Future Cup - Elimination Round
// URL : https://codeforces.com/contest/1146/problem/C
// Memory Limit : 256 MB
// Time Limit : 4000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//look at my code
//my code is amazing
#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll long long
#define int long long
#define mod 1000000007 //998244353
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define nl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define cout1(a) cout<<a<<nl
#define cout2(a,b) cout<<a<<" "<<b<<nl
#define cout3(a,b,c) cout<<a<<" "<<b<<" "<<c<<nl
#define cout4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<nl
#define vcout(v,i) cout<<v[i].fi<<" "<<v[i].se<<nl
#define x first
#define y second
#define vc vector
#define pb push_back
#define ar array
#define all(a) (a).begin(), (a).end()
#define ms(v,n,x) fill(v,v+n,x);
#define init(c,a) memset(c,a,sizeof(c))
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define maxi(a,b,c) max(a,max(b,c))
#define maxii(a,b,c,d) max(max(a,b),max(c,d))
#define mini(a,b,c) min(a,min(b,c))
#define md(a,b)  ((a%mod)*(b%mod)+mod)%mod
#define inf 9e18
#define cases ll T;cin>>T;while(T--)
#define BLOCK 500
//const double PI = 3.141592653589793238460;
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
// void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// const int N=;
ll query(vll ask1,vll ask2){
	cout<<ask1.size()<<" ";
	for(auto i:ask1)
	cout<<i<<" ";
	cout<<ask2.size()<<" ";
	for(auto i:ask2)
	cout<<i<<" ";
	cout<<endl;
	ll x;
	cin>>x;
	return x;

}
int32_t main()
{

	fast
	cases{
		ll n;
		cin>>n;
		vll ask1,ask2;
		ask1.pb(1);
		for(ll i=2;i<=n;i++)
		ask2.pb(i);
		ll x=query(ask1,ask2);
		ll l=2,h=n,an=2;
		while(l<h){
			ask2.clear();
			ll m=(l+h)>>1;
			for(ll i=2;i<=m;i++){
				ask2.pb(i);
			}
			ll p=query(ask1,ask2);
			if(p!=x){
				l=m+1;
			}
			else{
				an=m;
				h=m;
			}
			// debug(l,h,m,p);

		}
		l=an;
		ask1.clear();
		ask2.clear();
		ask1.pb(l);
		for(ll i=1;i<=n;i++)
		if(i!=l)
		ask2.pb(i);
		// debug(l);

		ll ans=query(ask1,ask2);
		cout<<"-1 "<<ans<<endl;
	}

	return 0;

}


// Problem : C. Tree Diameter
// Contest : Codeforces - Forethought Future Cup - Elimination Round
// URL : https://codeforces.com/contest/1146/problem/C
// Memory Limit : 256 MB
// Time Limit : 4000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//look at my code
//my code is amazing
#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll long long
#define int long long
#define mod 1000000007 //998244353
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define nl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define cout1(a) cout<<a<<nl
#define cout2(a,b) cout<<a<<" "<<b<<nl
#define cout3(a,b,c) cout<<a<<" "<<b<<" "<<c<<nl
#define cout4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<nl
#define vcout(v,i) cout<<v[i].fi<<" "<<v[i].se<<nl
#define x first
#define y second
#define vc vector
#define pb push_back
#define ar array
#define all(a) (a).begin(), (a).end()
#define ms(v,n,x) fill(v,v+n,x);
#define init(c,a) memset(c,a,sizeof(c))
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define maxi(a,b,c) max(a,max(b,c))
#define maxii(a,b,c,d) max(max(a,b),max(c,d))
#define mini(a,b,c) min(a,min(b,c))
#define md(a,b)  ((a%mod)*(b%mod)+mod)%mod
#define inf 9e18
#define cases ll T;cin>>T;while(T--)
#define BLOCK 500
//const double PI = 3.141592653589793238460;
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
// void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// const int N=;
ll query(vll ask1,vll ask2){
	cout<<ask1.size()<<" "<<ask2.size()<<" ";
	for(auto i:ask1)
	cout<<i<<" ";

	for(auto i:ask2)
	cout<<i<<" ";
	cout<<endl;
	ll x;
	cin>>x;
	return x;

}
int32_t main()
{

	fast
	cases{
		ll n;
		cin>>n;
		vll ask1,ask2,ask3,ask;
		ask1.pb(1);
		for(ll i=2;i<=n;i++)
		ask2.pb(i);
		ll x=query(ask1,ask2);
		for(ll l=2;l<=n;l++)
		ask.pb(l);
		ll an=2;
		f(i,7){

			if(ask.size()==1){
			an=ask[0];
			break;
			}
			ask2.clear();
			ask3.clear();
			ll m=0;
			for(ll i:ask){
				if(!(m&1))
				ask2.pb(i);
				else
				ask3.pb(i);
				m++;
			}
			if(ask2.size()==0)
			{
				an=ask3[0];
				break;
			}
			ll p=query(ask1,ask2);

			if(p!=x){
				ask=ask3;
			}
			else{
				ask=ask2;
			}
			// debug(l,h,m,p);

		}

		ask1.clear();
		ask2.clear();
		ask1.pb(an);
		for(ll i=1;i<=n;i++)
		if(i!=an)
		ask2.pb(i);
		// debug(l);

		ll ans=query(ask1,ask2);
		cout<<"-1 "<<ans<<endl;
	}

	return 0;

}


// Problem : C. Tree Diameter
// Contest : Codeforces - Forethought Future Cup - Elimination Round
// URL : https://codeforces.com/contest/1146/problem/C
// Memory Limit : 256 MB
// Time Limit : 4000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//look at my code
//my code is amazing
#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll long long
#define int long long
#define mod 1000000007 //998244353
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define nl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define cout1(a) cout<<a<<nl
#define cout2(a,b) cout<<a<<" "<<b<<nl
#define cout3(a,b,c) cout<<a<<" "<<b<<" "<<c<<nl
#define cout4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<nl
#define vcout(v,i) cout<<v[i].fi<<" "<<v[i].se<<nl
#define x first
#define y second
#define vc vector
#define pb push_back
#define ar array
#define all(a) (a).begin(), (a).end()
#define ms(v,n,x) fill(v,v+n,x);
#define init(c,a) memset(c,a,sizeof(c))
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define maxi(a,b,c) max(a,max(b,c))
#define maxii(a,b,c,d) max(max(a,b),max(c,d))
#define mini(a,b,c) min(a,min(b,c))
#define md(a,b)  ((a%mod)*(b%mod)+mod)%mod
#define inf 9e18
#define cases ll T;cin>>T;while(T--)
#define BLOCK 500
//const double PI = 3.141592653589793238460;
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
// void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

// const int N=;
ll query(vll ask1,vll ask2){
	cout<<ask1.size()<<" ";
	for(auto i:ask1)
	cout<<i<<" ";
	cout<<ask2.size()<<" ";
	for(auto i:ask2)
	cout<<i<<" ";
	cout<<endl;
	ll x;
	cin>>x;
	return x;

}
int32_t main()
{

	fast
	cases{
		ll n;
		cin>>n;
		vll ask1,ask2;
		ask1.pb(1);
		for(ll i=2;i<=n;i++)
		ask2.pb(i);
		ll x=query(ask1,ask2);
		ll l=2,h=n,an=1;
		while(l<h){
			ask2.clear();
			ll m=(l+h)>>1;
			for(ll i=2;i<=m;i++){
				ask2.pb(i);
			}
			ll p=query(ask1,ask2);
			if(p!=x){
				l=m+1;
			}
			else{
				an=m;
				h=m;
			}
			// debug(l,h,m,p);

		}
		l=an;
		ask1.clear();
		ask2.clear();
		ask1.pb(l);
		for(ll i=1;i<=n;i++)
		if(i!=l)
		ask2.pb(i);
		// debug(l);

		ll ans=query(ask1,ask2);
		cout<<"-1 "<<ans<<endl;
	}

	return 0;

}


#include <bits/stdc++.h>

using namespace std;

int main() {
    //ios_base::sync_with_stdio(false);
    cin.tie(0);
    //cout.tie(0);
    int t;
    cin >> t;
    for (int i1 = 0; i1 < t; ++i1) {
        int n;
        cin >> n;
        int ans = 0;
        for (int bits = 0; bits < 8; bits++) {
            vector<int> a;
            vector<int> b;
            for (int i = 0; i < n; ++i) {
                if ((i >> bits) & 1) {
                    a.push_back(i);
                } else {
                    b.push_back(i);
                }
                if (a.empty() || b.empty()) continue;
                cout << a.size() << " " << b.size() ;
                for (int x : a) {
                    cout << " " << x + 1;
                }
                for (int x : b) {
                    cout << " " << x + 1;
                }
                cout << endl;
                int tmp;
                cin >> tmp;
                ans = max(ans, tmp);
            }
        }
        cout << "-1" <<  " " << ans << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    //ios_base::sync_with_stdio(false);
    cin.tie(0);
    //cout.tie(0);
    int t;
    cin >> t;
    for (int i1 = 0; i1 < t; ++i1) {
        int n;
        cin >> n;
        int ans = 0;
        for (int bits = 0; bits < 9; bits++) {
            vector<int> a;
            vector<int> b;
            for (int i = 0; i < n; ++i) {
                if ((i >> bits) & 1) {
                    a.push_back(i);
                } else {
                    b.push_back(i);
                }
                if (a.empty() || b.empty()) continue;
                cout << a.size() << " " << b.size() ;
                for (int x : a) {
                    cout << " " << x + 1;
                }
                for (int x : b) {
                    cout << " " << x + 1;
                }
                cout << endl;
                int tmp;
                cin >> tmp;
                ans = max(ans, tmp);
            }
        }
        cout << "-1" <<  " " << ans << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    int ans = 0;
    for (int bit = 0; bit < 9; bit++) {
      vector<int> a;
      vector<int> b;
      for (int i = 0; i < n; i++) {
        if ((i >> bit) & 1) {
          a.push_back(i);
        } else {
          b.push_back(i);
        }
      }
      if (a.empty() || b.empty()) {
        continue;
      }
      cout << (int) a.size() << " " << (int) b.size();
      for (int x : a) {
        cout << " " << x + 1;
      }
      for (int x : b) {
        cout << " " << x + 1;
      }
      cout << endl;
      int foo;
      cin >> foo;
      ans = max(ans, foo);
    }
    cout << -1 << " " << ans << endl;
  }
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    for (int i1 = 0; i1 < t; ++i1) {
        int n;
        cin >> n;
        int ans = -1;
        for (int bits = 0; bits < 9; bits++) {
            vector<int> a;
            vector<int> b;
            for (int i = 0; i < n; ++i) {
                if (i >> bits != 0) {
                    a.push_back(i + 1);
                } else {
                    b.push_back(i + 1);
                }
                if (a.empty() || b.empty()) continue;
                cout << a.size() << " " << b.size() << " ";
                for (int x : a) {
                    cout << x << " ";
                }
                for (int x : b) {
                    cout << x << " ";
                }
                cout << "\n";
                cout.flush();
                int tmp;
                cin >> tmp;
                ans = max(ans, tmp);
            }
        }
        cout << ans << "\n";
        cout.flush();
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    for (int i1 = 0; i1 < t; ++i1) {
        int n;
        cin >> n;
        int ans = 0;
        for (int bits = 0; bits < 9; bits++) {
            vector<int> a;
            vector<int> b;
            for (int i = 0; i < n; ++i) {
                if ((i >> bits) & 1) {
                    a.push_back(i + 1);
                } else {
                    b.push_back(i + 1);
                }
                if (a.empty() || b.empty()) continue;
                cout << a.size() << " " << b.size() << " ";
                for (int x : a) {
                    cout << x << " ";
                }
                for (int x : b) {
                    cout << x << " ";
                }
                cout << "\n";
                cout.flush();
                int tmp;
                cin >> tmp;
                ans = max(ans, tmp);
            }
        }
        cout << "-1 " << ans << "\n";
        cout.flush();
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    //ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    for (int i1 = 0; i1 < t; ++i1) {
        int n;
        cin >> n;
        int ans = 0;
        for (int bits = 0; bits < 9; bits++) {
            vector<int> a;
            vector<int> b;
            for (int i = 0; i < n; ++i) {
                if ((i >> bits) & 1) {
                    a.push_back(i);
                } else {
                    b.push_back(i);
                }
                if (a.empty() || b.empty()) continue;
                cout << a.size() << " " << b.size() ;
                for (int x : a) {
                    cout << " " << x + 1;
                }
                for (int x : b) {
                    cout << " " << x + 1;
                }
                cout << endl;
                int tmp;
                cin >> tmp;
                ans = max(ans, tmp);
            }
        }
        cout << "-1 " << ans << "\n";
        cout.flush();
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    for (int i1 = 0; i1 < t; ++i1) {
        int n;
        cin >> n;
        int ans = -1;
        for (int bits = 0; bits < 9; bits++) {
            vector<int> a;
            vector<int> b;
            for (int i = 0; i < n; ++i) {
                if (i >> bits != 0) {
                    a.push_back(i + 1);
                } else {
                    b.push_back(i + 1);
                }
                if (a.empty() || b.empty()) continue;
                cout << a.size() << " " << b.size() << " ";
                for (int x : a) {
                    cout << x << " ";
                }
                for (int x : b) {
                    cout << x << " ";
                }
                cout << "\n";
                cout.flush();
                int tmp;
                cin >> tmp;
                ans = max(ans, tmp);
            }
        }
        cout << "-1 " << ans << "\n";
        cout.flush();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int max_dis,n;
void ask(int p)
{
     int maxi;
     vector<int> set1,set2;
     int i=1;
     while(i<=n){
           for(int j=0;i<=n && j<p;j++,i++)
               set1.push_back(i);
           for(int j=0;i<=n && j<p;j++,i++)
               set2.push_back(i);
     }
     cout<<set1.size()<<" "<<set2.size();
     for(i=0;i<set1.size();i++)
         cout<<" "<<set1[i];
     for(i=0;i<set2.size();i++)
         cout<<" "<<set2[i];
     cout<<endl;
     cin>>maxi;
     max_dis=max(max_dis,maxi);
}
int main()
{
    int t,T;
    int i,j,k;
    scanf("%d",&T);
    for(t=1;t<=T;t++){
    scanf("%d",&n);
    for(i=1,max_dis=0;i<n;i<<=2){
        ask(i);
    }
    cout<<"-1 "<<max_dis<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int max_dis,n;
void ask(int p)
{
     int maxi;
     vector<int> set1,set2;
     int i=1;
     while(i<=n){
           for(int j=0;i<=n && j<p;j++,i++)
               set1.push_back(i);
           for(int j=0;i<=n && j<p;j++,i++)
               set2.push_back(i);
     }
     cout<<set1.size()<<" "<<set2.size();
     for(i=0;i<set1.size();i++)
         cout<<" "<<set1[i];
     for(i=0;i<set2.size();i++)
         cout<<" "<<set2[i];
     cout<<endl;
     cin>>maxi;
     max_dis=max(max_dis,maxi);
}
int main()
{
    int t,T;
    int i,j,k;
    scanf("%d",&T);
    for(t=1;t<=T;t++){
    scanf("%d",&n);
    for(i=1,max_dis=0;i<n;i<<=1){
        ask(i);
    }
    cout<<"-1 "<<max_dis<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int max_dis;
void recurse(int l,int r)
{
    int maxi;
    int mid=(l+r)/2;
    if(l==r)
        return;
    cout<<(mid-l+1)<<" "<<(r-mid)<<" ";
    for(int i=l;i<=r;i++)
        cout<<i<<" ";
    cout<<endl;
    cin>>maxi;
    if(maxi==-1)
        exit(0);
    max_dis=max(max_dis,maxi);
    recurse(l,mid);
    recurse(mid+1,r);
}
int main()
{
    int t,T;
    int i,j,k;
    int n;
    cin>>T;
    for(t=0;t<T;t++){
    cin>>n;
    max_dis=0;
    recurse(1,n);
    cout<<"-1 "<<max_dis<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int max_dis;
void recurse(int l,int r)
{
    int maxi;
    int mid=(l+r)/2;
    if(l==r)
        return;
    cout<<(mid-l+1)<<" "<<(r-mid)<<" ";
    for(int i=l;i<=r;i++)
        cout<<i<<" ";
    cout<<endl;
    cin>>maxi;
    max_dis=max(max_dis,maxi);
    recurse(l,mid);
    recurse(mid+1,r);
}
int main()
{
    int t,T;
    int i,j,k;
    int n;
    scanf("%d",&T);
    for(t=0;t<T;t++){
    scanf("%d",&n);
    max_dis=0;
    recurse(1,n);
    printf("-1 %d\n",max_dis);
    }
}


#include<bits/stdc++.h>
using namespace std;
int max_dis;
void recurse(int l,int r)
{
    int maxi;
    int mid=(l+r)/2;
    if(l==r)
        return;
    cout<<(mid-l+1)<<" "<<(r-mid);
    for(int i=l;i<=r;i++)
        cout<<" "<<i;
    cout<<endl;
    cin>>maxi;
    if(maxi==-1)
        exit(0);
    max_dis=max(max_dis,maxi);
    recurse(l,mid);
    recurse(mid+1,r);
}
int main()
{
    int t,T;
    int i,j,k;
    int n;
    cin>>T;
    for(t=0;t<T;t++){
    cin>>n;
    max_dis=0;
    recurse(1,n);
    cout<<"-1 "<<max_dis<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int max_dis;
void recurse(int l,int r)
{
    int maxi;
    int mid=(l+r)/2;
    if(l==r)
        return;
    cout<<(mid-l+1)<<" "<<(r-mid)<<" ";
    for(int i=l;i<=r;i++)
        cout<<i<<" ";
    cout<<endl;
    cin>>maxi;
    max_dis=max(max_dis,maxi);
    recurse(l,mid);
    recurse(mid+1,r);
}
int main()
{
    int t,T;
    int i,j,k;
    int n;
    cin>>T;
    for(t=0;t<T;t++){
    cin>>n;
    max_dis=0;
    recurse(1,n);
    cout<<"-1 "<<max_dis<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long

using namespace std;

const int mxn=1e5+10;
int arr[mxn];
vector<int>q;
int tc,n;

void solve()
{
    printf("1 %d 1 ",n-1);
    for(auto v : q)printf("%d ",v);
    printf("\n");
    fflush(stdout);

    int need;
    scanf("%d",&need);

    vector<int>Ans1,Ans2;
    int d = q.size()/2;
    for(int i = 0; i<d; i++) Ans1.push_back(q[i]);
    for(int i = d; i<q.size(); i++) Ans2.push_back(q[i]);

    while(q.size()>1){

        printf("1 %d 1 ",Ans1.size());
        for(auto v : Ans1) printf("%d ",v);
        printf("\n");
        fflush(stdout);
        int nd ;
        scanf("%d",&nd);
        if(nd == need){
            q = Ans1;
        }
        else q = Ans2;

        Ans1.clear();
        Ans2.clear();

        int d = q.size()/2;
        for(int i = 0; i<d; i++) Ans1.push_back(q[i]);
        for(int i = d; i<q.size(); i++) Ans2.push_back(q[i]);
    }

    printf("1 %d ",n-1);
    printf("%d ",q[0]);
    for(int i = 1; i<=n; i++) if(i!=q[0])printf("%d ",i);
    printf("\n");
    fflush(stdout);

    int ans;
    scanf("%d",&ans);
    printf("-1 %d\n",ans);
    fflush(stdout);
}

int main()
{
    ios_base::sync_with_stdio(false);

    int tc;
    cin>>tc;
    while(tc--){
        int n;
        cin>>n;
        for(int i=2; i<=n; i++) q.push_back(i);
        solve();
    }

    return 0;
}


#include<bits/stdc++.h>
#define ll long long

using namespace std;

const int mxn=1e5+10;
int arr[mxn];
vector<int>q;
int tc,n;

void solve()
{
        cin>>n;
        vector <int>q;
        for(int j = 2; j<=n; j++) q.push_back(j);

        printf("1 %d 1 ",n-1);
        for(auto v : q)printf("%d ",v);
        printf("\n");
        fflush(stdout);

        int need;
        scanf("%d",&need);
        int len = q.size();
        vector< int > half1 , half2;
        int d = q.size()/2;
        for(int i = 0; i<d; i++)half1.push_back(q[i]);
        for(int i = d; i<q.size(); i++)half2.push_back(q[i]);

        while(q.size()>1){

            printf("1 %d 1 ",half1.size());
            for(auto v : half1)printf("%d ",v);
            printf("\n");
            fflush(stdout);
            int nd ;
            scanf("%d",&nd);
            if(nd == need){
                q = half1;
            }
            else q = half2;

            int len = q.size();
            half1.clear();
            half2.clear();
            int d = q.size()/2;
            for(int i = 0; i<d; i++)half1.push_back(q[i]);
            for(int i = d; i<q.size(); i++)half2.push_back(q[i]);

        }

        printf("1 %d ",n-1);
        printf("%d ",q[0]);
        for(int i = 1; i<=n; i++)if(i != q[0])printf("%d ",i);
        printf("\n");
        fflush(stdout);

        int ans;
        scanf("%d",&ans);
        printf("-1 %d\n",ans);
        fflush(stdout);
}

int main()
{

    ios_base::sync_with_stdio(false);

    cin>>tc;
    while(tc--){
        solve();
    }

    return 0;
}


#include<bits/stdc++.h>
#define ll long long

using namespace std;

const int mxn=1e5+10;
int arr[mxn];
vector<int>q;
int tc,n;

void solve()
{

}

int main()
{
    ios_base::sync_with_stdio(false);

    cin>>tc;
    while(tc--){
        cin>>n;
        for(int i=2; i<=n; i++) q.push_back(i);

        printf("1 %d 1 ",n-1);
        for(auto v : q)printf("%d ",v);
        printf("\n");
        fflush(stdout);

        int need;
        scanf("%d",&need);

        vector<int>Ans1,Ans2;
        int d = q.size()/2;
        for(int i = 0; i<d; i++) Ans1.push_back(q[i]);
        for(int i = d; i<q.size(); i++) Ans2.push_back(q[i]);

        while(q.size()>1){

            printf("1 %d 1 ",Ans1.size());
            for(auto v : Ans1) printf("%d ",v);
            printf("\n");
            fflush(stdout);
            int nd ;
            scanf("%d",&nd);
            if(nd == need){
                q = Ans1;
            }
            else q = Ans2;

            Ans1.clear();
            Ans2.clear();

            int d = q.size()/2;
            for(int i = 0; i<d; i++) Ans1.push_back(q[i]);
            for(int i = d; i<q.size(); i++) Ans2.push_back(q[i]);
        }

        printf("1 %d ",n-1);
        printf("%d ",q[0]);
        for(int i = 1; i<=n; i++) if(i!=q[0])printf("%d ",i);
        printf("\n");
        fflush(stdout);

        int ans;
        scanf("%d",&ans);
        printf("-1 %d\n",ans);
        fflush(stdout);
    }

    return 0;
}


#include<bits/stdc++.h>
#define ll long long

using namespace std;

const int mxn=1e5+10;
int arr[mxn];
vector<int>q;
int tc,n;

void solve()
{

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    cin>>tc;
    while(tc--){
        cin>>n;
        for(int i=2; i<=n; i++) q.push_back(i);

        printf("1 %d 1 ",n-1);
        for(auto v : q)printf("%d ",v);
        printf("\n");
        fflush(stdout);

        int need;
        scanf("%d",&need);

        vector<int>Ans1,Ans2;
        int d = q.size()/2;
        for(int i = 0; i<d; i++) Ans1.push_back(q[i]);
        for(int i = d; i<q.size(); i++) Ans2.push_back(q[i]);

        while(q.size()>1){

            printf("1 %d 1 ",Ans1.size());
            for(auto v : Ans1) printf("%d ",v);
            printf("\n");
            fflush(stdout);
            int nd ;
            scanf("%d",&nd);
            if(nd == need){
                q = Ans1;
            }
            else q = Ans2;

            Ans1.clear();
            Ans2.clear();

            int d = q.size()/2;
            for(int i = 0; i<d; i++) Ans1.push_back(q[i]);
            for(int i = d; i<q.size(); i++) Ans2.push_back(q[i]);
        }

        printf("1 %d ",n-1);
        printf("%d ",q[0]);
        for(int i = 1; i<=n; i++) if(i!=q[0])printf("%d ",i);
        printf("\n");
        fflush(stdout);

        int ans;
        scanf("%d",&ans);
        printf("-1 %d\n",ans);
        fflush(stdout);
    }

    return 0;
}


#include<bits/stdc++.h>
#define ll long long

using namespace std;

const int mxn=1e5+10;
int arr[mxn];
vector<int>v1;
int tc,n;

void solve()
{
    printf("1 %d 1 ",n-1);
    for(auto X : v1) printf("%d ",X);
    printf("\n");
    fflush(stdout);

    int mk;
    scanf("%d",&mk);

    vector<int>Ans1,Ans2;

    int d=v1.size()/2;
    for(int i = 0; i<d; i++) Ans1.push_back(v1[i]);
    for(int i = d; i<v1.size(); i++) Ans2.push_back(v1[i]);

    while(v1.size()>1){

        printf("1 %d 1 ",Ans1.size());
        for(auto X : Ans1) printf("%d ",X);
        printf("\n");
        fflush(stdout);

        int mk1;
        scanf("%d",&mk1);
        if(mk1==mk) v1=Ans1;
        else v1 = Ans2;

        Ans1.clear();
        Ans2.clear();

        int d=v1.size()/2;
        for(int i=0; i<d; i++) Ans1.push_back(v1[i]);
        for(int i=d; i<v1.size(); i++) Ans2.push_back(v1[i]);
    }

        printf("1 %d ",n-1);
        printf("%d ",v1[0]);
        for(int i = 1; i<=n; i++)if(i!=v1[0]) printf("%d ",i);
        printf("\n");
        fflush(stdout);

        int ans;
        scanf("%d",&ans);
        printf("-1 %d\n",ans);
        fflush(stdout);
}

int main()
{
    ios_base::sync_with_stdio(false);

    cin>>tc;
    while(tc--){
        cin>>n;
        for(int i=2; i<=n; i++) v1.push_back(i);
        solve();
    }

    return 0;
}


#include<bits/stdc++.h>
#define ll long long

using namespace std;

const int mxn=1e5+10;
int arr[mxn];
vector<int>q;
int tc,n;

void solve()
{
    printf("1 %d 1 ",n-1);
    for(auto v : q)printf("%d ",v);
    printf("\n");
    fflush(stdout);

    int need;
    scanf("%d",&need);

    vector<int>Ans1,Ans2;
    int d = q.size()/2;
    for(int i = 0; i<d; i++) Ans1.push_back(q[i]);
    for(int i = d; i<q.size(); i++) Ans2.push_back(q[i]);

    while(q.size()>1){

        printf("1 %d 1 ",Ans1.size());
        for(auto v : Ans1) printf("%d ",v);
        printf("\n");
        fflush(stdout);
        int nd ;
        scanf("%d",&nd);
        if(nd == need){
            q = Ans1;
        }
        else q = Ans2;

        Ans1.clear();
        Ans2.clear();

        int d = q.size()/2;
        for(int i = 0; i<d; i++) Ans1.push_back(q[i]);
        for(int i = d; i<q.size(); i++) Ans2.push_back(q[i]);
    }

    printf("1 %d ",n-1);
    printf("%d ",q[0]);
    for(int i = 1; i<=n; i++) if(i!=q[0])printf("%d ",i);
    printf("\n");
    fflush(stdout);

    int ans;
    scanf("%d",&ans);
    printf("-1 %d\n",ans);
    fflush(stdout);
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int tc;
    cin>>tc;
    while(tc--){
        int n;
        cin>>n;
        for(int i=2; i<=n; i++) q.push_back(i);
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout<<endl;
ll maxi=LLONG_MIN;
ll mini=LLONG_MAX;
void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); }
ll t,i,j,k,n,temp,flag,ans,m;

int main() {

	#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\AJAY KRISSHAN N K\\Desktop\\Ajay\\Codes\\in.txt", "r", stdin);
	freopen("C:\\Users\\AJAY KRISSHAN N K\\Desktop\\Ajay\\Codes\\out.txt", "w", stdout);
	#endif
	int t;
	cin>>t;
	while(t--)
	{
		int n,d,dis;
		cin>>n;
		cout<<1<<" "<<n-1<<" "<<1<<" ";
		for(int i=2;i<=n;i++)
		{
			cout<<i<<" ";
		}
		cout<<"\n";
		fflush(stdout);
		cin>>d;
		int l=2,r=n;
		while(l<r)
		{
			int mid =l+r;
			mid/=2;
			cout<<1<<" "<<mid-l+1<<" "<<1<<" ";
			for(int i=l;i<=mid;i++)
			{
				cout<<i<<" ";
			}
			cout<<"\n";
			fflush(stdout);
			cin>>dis;
			if(d<dis)
			{
				r=mid;
			}
			else
			{
				l=mid+1;
			}
		}
		cout<<l<<" "<<n-1<<" "<<1<<" ";
		for(int i=1;i<=n;i++)
		{
			if(i!=l)
			cout<<i<<" ";
		}
		cout<<"\n";
		fflush(stdout);
		cin>>d;
		cout<<-1<<" "<<d<<"\n";
		fflush(stdout);
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout<<endl;
ll maxi=LLONG_MIN;
ll mini=LLONG_MAX;
void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); }
ll t,i,j,k,n,temp,flag,ans,m;

int main() {
	int t;
	cin>>t;
	while(t--)
	{
		int n,d,dis;
		cin>>n;
		cout<<1<<" "<<n-1<<" "<<1<<" ";
		for(int i=2;i<=n;i++)
		{
			cout<<i<<" ";
		}
		fflush(stdout);
		cin>>d;
		int l=2,r=n;
		while(l<r)
		{
			int mid =l+r;
			mid/=2;
			cout<<1<<" "<<mid-l+1<<" "<<1<<" ";
			for(int i=l;i<=mid;i++)
			{
				cout<<i<<" ";
			}
			fflush(stdout);
			cin>>dis;
			if(d<dis)
			{
				r=mid;
			}
			else
			{
				l=mid+1;
			}
		}
		cout<<1<<" "<<n-1<<" "<<l<<" ";
		for(int i=1;i<=n;i++)
		{
			if(i!=l)
			cout<<i<<" ";
		}
		fflush(stdout);
		cin>>d;
		cout<<-1<<" "<<d<<"\n";
		fflush(stdout);
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout<<endl;
ll maxi=LLONG_MIN;
ll mini=LLONG_MAX;
void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); }
ll t,i,j,k,n,temp,flag,ans,m;

int main() {
	int t;
	cin>>t;
	while(t--)
	{
		int n,d,dis;
		cin>>n;
		if(n==1)
		{
			cout<<-1<<" "<<0<<"\n";
			continue;
		}
		cout<<1<<" "<<n-1<<" "<<1<<" ";
		for(int i=2;i<=n;i++)
		{
			cout<<i<<" ";
		}
		fflush(stdout);
		cin>>d;
		int l=2,r=n;
		while(l<r)
		{
			int mid =l+r;
			mid/=2;
			cout<<1<<" "<<mid-l+1<<" "<<1<<" ";
			for(int i=l;i<=mid;i++)
			{
				cout<<i<<" ";
			}
			fflush(stdout);
			cin>>dis;
			if(d<dis)
			{
				r=mid;
			}
			else
			{
				l=mid+1;
			}
		}
		cout<<1<<" "<<n-1<<" "<<l<<" ";
		for(int i=1;i<=n;i++)
		{
			if(i!=l)
			cout<<i<<" ";
		}
		fflush(stdout);
		cin>>d;
		cout<<-1<<" "<<d<<"\n";
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout<<endl;
ll maxi=LLONG_MIN;
ll mini=LLONG_MAX;
void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); }
ll t,i,j,k,n,temp,flag,ans,m;

int main() {
	int t;
	cin>>t;
	while(t--)
	{
		ll n,d,dis;
		cin>>n;
		cout<<1<<" "<<n-1<<" "<<1<<" ";
		for(int i=2;i<=n;i++)
		{
			cout<<i<<" ";
		}
		fflush(stdout);
		cin>>d;
		int l=2,r=n;
		while(l<r)
		{
			ll mid =l+r;
			mid/=2;
			cout<<1<<" "<<mid-l+1<<" "<<1<<" ";
			for(int i=l;i<=mid;i++)
			{
				cout<<i<<" ";
			}
			fflush(stdout);
			cin>>dis;
			if(d==dis)
			{
				r=mid;
			}
			else
			{
				l=mid+1;
			}
		}
		cout<<1<<" "<<n-1<<" "<<l<<" ";
		for(int i=1;i<=n;i++)
		{
			if(i!=l)
			cout<<i<<" ";
		}
		fflush(stdout);
		cin>>d;
		cout<<-1<<" "<<d<<"\n";
		fflush(stdout);
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout<<endl;
ll maxi=LLONG_MIN;
ll mini=LLONG_MAX;
void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); }
ll t,i,j,k,n,temp,flag,ans,m;

int main() {

	#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\AJAY KRISSHAN N K\\Desktop\\Ajay\\Codes\\in.txt", "r", stdin);
	freopen("C:\\Users\\AJAY KRISSHAN N K\\Desktop\\Ajay\\Codes\\out.txt", "w", stdout);
	#endif
	int t;
	cin>>t;
	while(t--)
	{
		ll n,d,dis;
		cin>>n;
		cout<<1<<" "<<n-1<<" "<<1<<" ";
		for(int i=2;i<=n;i++)
		{
			cout<<i<<" ";
		}
		//cout<<"\n";
		fflush(stdout);
		cin>>d;
		ll l=2,r=n;
		while(l<r)
		{
			ll mid =l+r;
			mid/=2;
			cout<<1<<" "<<mid-l+1<<" "<<1<<" ";
			for(int i=l;i<=mid;i++)
			{
				cout<<i<<" ";
			}
			//cout<<"\n";
			fflush(stdout);
			cin>>dis;
			if(d<dis)
			{
				r=mid;
			}
			else
			{
				l=mid+1;
			}
		}
		cout<<l<<" "<<n-1<<" "<<1<<" ";
		for(int i=1;i<=n;i++)
		{
			if(i!=l)
			cout<<i<<" ";
		}
		//cout<<"\n";
		fflush(stdout);
		cin>>d;
		cout<<-1<<" "<<d<<"\n";
		//fflush(stdout);
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout<<endl;
ll maxi=LLONG_MIN;
ll mini=LLONG_MAX;
void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); }
ll t,i,j,k,n,temp,flag,ans,m;

int main() {

	#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\AJAY KRISSHAN N K\\Desktop\\Ajay\\Codes\\in.txt", "r", stdin);
	freopen("C:\\Users\\AJAY KRISSHAN N K\\Desktop\\Ajay\\Codes\\out.txt", "w", stdout);
	#endif
	int t;
	cin>>t;
	while(t--)
	{
		int n,d,dis;
		cin>>n;
		cout<<1<<" "<<n-1<<" "<<1<<" ";
		for(int i=2;i<=n;i++)
		{
			cout<<i<<" ";
		}
		cout<<"\n";
		fflush(stdout);
		cin>>d;
		int l=2,r=n;
		while(l<r)
		{
			int mid =l+r;
			mid/=2;
			cout<<1<<" "<<mid-l+1<<" "<<1<<" ";
			for(int i=l;i<=mid;i++)
			{
				cout<<i<<" ";
			}
			cout<<"\n";
			fflush(stdout);
			cin>>dis;
			if(d<dis)
			{
				r=mid;
			}
			else
			{
				l=mid+1;
			}
		}
		cout<<l<<" "<<n-1<<" "<<1<<" ";
		for(int i=1;i<=n;i++)
		{
			if(i!=l)
			cout<<i<<" ";
		}
		cout<<"\n";
		fflush(stdout);
		cin>>d;
		cout<<-1<<" "<<d<<"\n";
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout<<endl;
ll maxi=LLONG_MIN;
ll mini=LLONG_MAX;
void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); }
ll t,i,j,k,n,temp,flag,ans,m;

int main() {

	#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\AJAY KRISSHAN N K\\Desktop\\Ajay\\Codes\\in.txt", "r", stdin);
	freopen("C:\\Users\\AJAY KRISSHAN N K\\Desktop\\Ajay\\Codes\\out.txt", "w", stdout);
	#endif
	int t;
	cin>>t;
	while(t--)
	{
		ll n,d,dis;
		cin>>n;
		cout<<1<<" "<<n-1<<" "<<1<<" ";
		for(int i=2;i<=n;i++)
		{
			cout<<i<<" ";
		}
		//cout<<"\n";
		fflush(stdout);
		cin>>d;
		ll l=2,r=n;
		while(l<r)
		{
			ll mid =l+r;
			mid/=2;
			cout<<1<<" "<<mid-l+1<<" "<<1<<" ";
			for(int i=l;i<=mid;i++)
			{
				cout<<i<<" ";
			}
			//cout<<"\n";
			fflush(stdout);
			cin>>dis;
			if(d<dis)
			{
				r=mid;
			}
			else
			{
				l=mid+1;
			}
		}
		cout<<l<<" "<<n-1<<" "<<1<<" ";
		for(int i=1;i<=n;i++)
		{
			if(i!=l)
			cout<<i<<" ";
		}
		//cout<<"\n";
		fflush(stdout);
		cin>>d;
		cout<<-1<<" "<<d<<"\n";
		fflush(stdout);
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout<<endl;
ll maxi=LLONG_MIN;
ll mini=LLONG_MAX;
void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); }
ll t,i,j,k,n,temp,flag,ans,m;

int main() {
	int t;
	cin>>t;
	while(t--)
	{
		ll n,d,dis;
		cin>>n;
		cout<<1<<" "<<n-1<<" "<<1<<" ";
		for(int i=2;i<=n;i++)
		{
			cout<<i<<" ";
		}
		fflush(stdout);
		cin>>d;
		int l=2,r=n;
		while(l<r)
		{
			ll mid =l+r;
			mid/=2;
			cout<<1<<" "<<mid-l+1<<" "<<1<<" ";
			for(int i=l;i<=mid;i++)
			{
				cout<<i<<" ";
			}
			fflush(stdout);
			cin>>dis;
			if(d<dis)
			{
				r=mid;
			}
			else
			{
				l=mid+1;
			}
		}
		cout<<1<<" "<<n-1<<" "<<l<<" ";
		for(int i=1;i<=n;i++)
		{
			if(i!=l)
			cout<<i<<" ";
		}
		fflush(stdout);
		cin>>d;
		cout<<-1<<" "<<d<<"\n";
		fflush(stdout);
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout<<endl;
ll maxi=LLONG_MIN;
ll mini=LLONG_MAX;
void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); }
ll t,i,j,k,n,temp,flag,ans,m;

int main() {
	int t;
	cin>>t;
	while(t--)
	{
		int n,d,dis;
		cin>>n;
		if(n==1)
		{
			cout<<0<<"\n";
			continue;
		}
		cout<<1<<" "<<n-1<<" "<<1<<" ";
		for(int i=2;i<=n;i++)
		{
			cout<<i<<" ";
		}
		fflush(stdout);
		cin>>d;
		int l=2,r=n;
		while(l<r)
		{
			int mid =l+r;
			mid/=2;
			cout<<1<<" "<<mid-l+1<<" "<<1<<" ";
			for(int i=l;i<=mid;i++)
			{
				cout<<i<<" ";
			}
			fflush(stdout);
			cin>>dis;
			if(d<dis)
			{
				r=mid;
			}
			else
			{
				l=mid+1;
			}
		}
		cout<<1<<" "<<n-1<<" "<<l<<" ";
		for(int i=1;i<=n;i++)
		{
			if(i!=l)
			cout<<i<<" ";
		}
		fflush(stdout);
		cin>>d;
		cout<<-1<<" "<<d<<"\n";
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout<<endl;
ll maxi=LLONG_MIN;
ll mini=LLONG_MAX;
void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); }
ll t,i,j,k,n,temp,flag,ans,m;

int main() {
	int t;
	cin>>t;
	while(t--)
	{
		int n,d,dis;
		cin>>n;
		cout<<1<<" "<<n-1<<" "<<1<<" ";
		for(int i=2;i<=n;i++)
		{
			cout<<i<<" ";
		}
		fflush(stdout);
		cin>>d;
		int l=2,r=n;
		while(l<r)
		{
			int mid =l+r;
			mid/=2;
			cout<<1<<" "<<mid-l+1<<" "<<1<<" ";
			for(int i=l;i<=mid;i++)
			{
				cout<<i<<" ";
			}
			fflush(stdout);
			cin>>dis;
			if(d<dis)
			{
				r=mid;
			}
			else
			{
				l=mid+1;
			}
		}
		cout<<1<<" "<<n-1<<" "<<l<<" ";
		for(int i=1;i<=n;i++)
		{
			if(i!=l)
			cout<<i<<" ";
		}
		fflush(stdout);
		cin>>d;
		cout<<-1<<" "<<d<<"\n";
	}

	return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <assert.h>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <bitset>
#include <string>
#include <sstream>
#include <memory.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <functional>
#include <algorithm>
using namespace std;
typedef long long ll;
int n;
int ask(int l, int r) {
	printf("1 %d 1", r - l + 1);
	for (int i = l; i <= r; ++i)
		printf(" %d", i + 1);
	printf("\n");
	fflush(0);
	int x;
	scanf("%d", &x);
	return x;
}
int main()
{
	int t;
	scanf("%d", &t);
	while (t--) {
		scanf("%d", &n);
		int l = 1, r = n - 1, at;
		int d = ask(l, r);
		while (l <= r) {
			int m = (l + r) / 2;
			if (ask(m, r) == d) {
				at = m;
				l = m + 1;
			}
			else
				r = m;
		}
		printf("%d %d %d", 1, at + 1, n - 1);
		for (int i = 0; i < n; ++i)
			if (i != at)
				printf(" %d", i + 1);
		printf("\n");
		fflush(0);
		int x;
		scanf("%d", &x);
		printf("-1 %d\n", x);
		fflush(0);
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <assert.h>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <bitset>
#include <string>
#include <sstream>
#include <memory.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <functional>
#include <algorithm>
using namespace std;
typedef long long ll;
int n;
int ask(int l, int r) {
	printf("1 %d 1", r - l + 1);
	for (int i = l; i <= r; ++i)
		printf(" %d", i + 1);
	printf("\n");
	fflush(0);
	int x;
	scanf("%d", &x);
	return x;
}
int main()
{
	int t;
	scanf("%d", &t);
	while (t--) {
		scanf("%d", &n);
		int l = 2, r = n - 1, at = 1;
		int d = ask(l, r);
		while (l <= r) {
			int m = (l + r) / 2;
			if (ask(m, n - 1) == d) {
				at = m;
				l = m + 1;
			}
			else
				r = m;
		}
		printf("%d %d %d", 1, n - 1, at + 1);
		for (int i = 0; i < n; ++i)
			if (i != at)
				printf(" %d", i + 1);
		printf("\n");
		fflush(0);
		int x;
		scanf("%d", &x);
		printf("-1 %d\n", x);
		fflush(0);
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <assert.h>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <bitset>
#include <string>
#include <sstream>
#include <memory.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <functional>
#include <algorithm>
using namespace std;
typedef long long ll;
int n;
int ask(int l, int r) {
	printf("1 %d 1", r - l + 1);
	for (int i = l; i <= r; ++i)
		printf(" %d", i + 1);
	printf("\n");
	fflush(0);
	int x;
	scanf("%d", &x);
	return x;
}
int main()
{
	int t;
	scanf("%d", &t);
	while (t--) {
		scanf("%d", &n);
		int l = 1, r = n - 1, at;
		int d = ask(l, r);
		while (l <= r) {
			int m = (l + r) / 2;
			if (ask(m, r) == d) {
				at = m;
				l = m + 1;
			}
			else
				r = m;
		}
		printf("%d %d %d", 1, n - 1, at + 1);
		for (int i = 0; i < n; ++i)
			if (i != at)
				printf(" %d", i + 1);
		printf("\n");
		fflush(0);
		int x;
		scanf("%d", &x);
		printf("-1 %d\n", x);
		fflush(0);
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <assert.h>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <bitset>
#include <string>
#include <sstream>
#include <memory.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <functional>
#include <algorithm>
using namespace std;
typedef long long ll;
int n;
int Q = 0;
int ask(int l, int r) {
	++Q;
	if (Q > 8)
		assert(false);
	printf("1 %d 1", r - l + 1);
	for (int i = l; i <= r; ++i)
		printf(" %d", i + 1);
	printf("\n");
	fflush(0);
	int x;
	scanf("%d", &x);
	return x;
}
int main()
{
	int t;
	scanf("%d", &t);
	while (t--) {
		Q = 0;
		scanf("%d", &n);
		int l = 2, r = n - 1, at = 1;
		int d = ask(1, n - 1);
		while (l <= r) {
			int m = (l + r) / 2;
			if (ask(m, n - 1) == d) {
				at = m;
				l = m + 1;
			}
			else
				r = m - 1;
		}
		printf("%d %d %d", 1, n - 1, at + 1);
		for (int i = 0; i < n; ++i)
			if (i != at)
				printf(" %d", i + 1);
		printf("\n");
		fflush(0);
		int x;
		scanf("%d", &x);
		printf("-1 %d\n", x);
		fflush(0);
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <assert.h>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <bitset>
#include <string>
#include <sstream>
#include <memory.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <functional>
#include <algorithm>
using namespace std;
typedef long long ll;
int n;
int Q = 0;
int ask(int l, int r) {
	++Q;
	if (Q > 8)
		assert(false);
	printf("1 %d 1", r - l + 1);
	for (int i = l; i <= r; ++i)
		printf(" %d", i + 1);
	printf("\n");
	fflush(0);
	int x;
	scanf("%d", &x);
	return x;
}
int main()
{
	int t;
	scanf("%d", &t);
	while (t--) {
		scanf("%d", &n);
		int l = 2, r = n - 1, at = 1;
		int d = ask(1, n - 1);
		while (l <= r) {
			int m = (l + r) / 2;
			if (ask(m, n - 1) == d) {
				at = m;
				l = m + 1;
			}
			else
				r = m - 1;
		}
		printf("%d %d %d", 1, n - 1, at + 1);
		for (int i = 0; i < n; ++i)
			if (i != at)
				printf(" %d", i + 1);
		printf("\n");
		fflush(0);
		int x;
		scanf("%d", &x);
		printf("-1 %d\n", x);
		fflush(0);
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <assert.h>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <bitset>
#include <string>
#include <sstream>
#include <memory.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <functional>
#include <algorithm>
using namespace std;
typedef long long ll;
int n;
int ask(int l, int r) {
	printf("1 %d 1", n - 1);
	for (int i = l; i <= r; ++i)
		printf(" %d", i + 1);
	printf("\n");
	fflush(0);
	int x;
	scanf("%d", &x);
	return x;
}
int main()
{
	int t;
	scanf("%d", &t);
	while (t--) {
		scanf("%d", &n);
		int l = 1, r = n - 1, at;
		int d = ask(l, r);
		while (l <= r) {
			int m = (l + r) / 2;
			if (ask(m, r) == d) {
				at = m;
				l = m + 1;
			}
			else
				r = m;
		}
		printf("%d %d %d", 1, at + 1, n - 1);
		for (int i = 0; i < n; ++i)
			if (i != at)
				printf(" %d", i + 1);
		printf("\n");
		fflush(0);
		int x;
		scanf("%d", &x);
		printf("%d\n", x);
		fflush(0);
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <assert.h>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <bitset>
#include <string>
#include <sstream>
#include <memory.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <functional>
#include <algorithm>
using namespace std;
typedef long long ll;
int n;
int ask(int l, int r) {
	printf("1 %d 1", n - 1);
	for (int i = l; i <= r; ++i)
		printf(" %d", i + 1);
	printf("\n");
	fflush(0);
	int x;
	scanf("%d", &x);
	return x;
}
int main()
{
	int t;
	scanf("%d", &t);
	while (t--) {
		scanf("%d", &n);
		int l = 1, r = n - 1, at;
		int d = ask(l, r);
		while (l <= r) {
			int m = (l + r) / 2;
			if (ask(m, r) == d) {
				at = m;
				l = m + 1;
			}
			else
				r = m;
		}
		printf("%d %d %d", 1, at + 1, n - 1);
		for (int i = 0; i < n; ++i)
			if (i != at)
				printf(" %d", i + 1);
		printf("\n");
		fflush(0);
		int x;
		scanf("%d", &x);
		printf("-1 %d\n", x);
		fflush(0);
	}
	return 0;
}