#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(1, 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 <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <random>
#include <iomanip>

#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#include <deque>
#include <array>
#include <iterator>
#include <bitset>
#include <initializer_list>

using namespace std;

#include <ext/rope>

using namespace __gnu_cxx;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define int long long

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

#define add push_back
#define rem pop_back
#define ALL( x ) x.begin(), x.end()
#define SORT( x ) sort(ALL(x))
#define REV( x ) reverse(ALL(x))
#define F first
#define S second
#define DEBUG( x ) cout << #x << " " << x << endl;
#define forn( i, a, b ) for(int i = a; i <= b; i++)

template < typename T1, typename T2 >
auto max( T1 a, T2 b ) {
	auto max = a > b ? a : b;
	return max;
}

template < typename T1, typename T2 >
auto min( T1 a, T2 b ) {
	auto min = a < b ? a : b;
	return min;
}

template < typename T1, typename T2 >
void updmax( T1 & a, T2 b ) { a = a > b ? a : b; }

template < typename T1, typename T2 >
void updmin( T1 & a, T2 b ) { a = a < b ? a : b; }

const double EPS = 1e-9;
const double PI = acos( -1. );
const int mod = 1e9 + 7;
int inf = __INT64_MAX__;
string YN[] = { "NO", "YES" };

#define gcd( a, b ) __gcd(a, b)
#define lcm( a, b ) ((a)*((b)/gcd(a,b)))

inline int gcd_e( int a, int b, int & x, int & y ) {
	if( !a ) {
		x = 0;
		y = 1;
		return b;
	}
	int x1, y1;
	int d = gcd_e( b % a, a, x1, y1 );
	x = y1 - ( b / a ) * x1;
	y = x1;
	return d;
}

inline int div_mod( int a, int b, int m = mod ) {
	int x, y;
	int g = gcd_e( b, m, x, y );
	x = ( x % m + m ) % m;
	return ( a * x ) % m;
}

int pow_mod( int a, int n, int m = mod ) {
	int res = 1;
	while( n ) {
		if( n & 1 )
			res = ( res * a ) % m;
		a = ( a * a ) % m;
		n >>= 1;
	}
	return res;
}

int px[] = { 1, -1, 0, 0 };
int py[] = { 0, 0, -1, 1 };
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };

//tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> tr;

static const int MAXN = 1 << 20;
static int a[MAXN], b[MAXN];

int n, m, k;
int res, ans, cnt;
string s;

int used[MAXN];

int f( int x, int a, int b, int dx ) {
	used[dx] = 1;
	if( dx > x ) return 0;
	if( !used[dx + a] )
		f( x, a, b, dx + a );
	if( dx - a >= 0 && !used[dx - b] )
		f( x, a, b, dx - b );

}

void solution( ) {
	cin >> n;
	cout << "1 " << n - 1 << " ";
	for( int i = 1; i <= n; i++ ) cout << i << " ";
	cout << endl;
	int x;
	cin >> x;
	int l = 1, r = n;
	while( r - l > 1 ) {
		int m = ( r + l ) >> 1;
		cout << "1 " << m << " ";
		for( int i = 1; i <= m; i++ ) cout << i << " ";
		cout << endl;
		int y;
		cin >> y;
		if( y == x ) {
			r = m;
		} else {
			l = m;
		}
	}
	cout << 1 << " " << n - 1 << " ";
	cout << r << " ";
	for( int i = 1; i <= n; i++ ) {
		if( r == i ) {
			continue;
		}
		cout << i << " ";
	}
	cout << endl;
	cin >> x;
	cout << "-1" << " " << x << endl;
}

int32_t main( ) {

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	ios_base::sync_with_stdio( false );
	cin.tie( nullptr );
	cout.tie( nullptr );
	//cout.precision(15);

	int query = 1;
	cin >> query;

	while( query-- ) solution();

	return 0;

}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <random>
#include <iomanip>

#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#include <deque>
#include <array>
#include <iterator>
#include <bitset>
#include <initializer_list>

using namespace std;

#include <ext/rope>

using namespace __gnu_cxx;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define int long long

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

#define add push_back
#define rem pop_back
#define ALL( x ) x.begin(), x.end()
#define SORT( x ) sort(ALL(x))
#define REV( x ) reverse(ALL(x))
#define F first
#define S second
#define DEBUG( x ) cout << #x << " " << x << endl;
#define forn( i, a, b ) for(int i = a; i <= b; i++)

template < typename T1, typename T2 >
auto max( T1 a, T2 b ) {
	auto max = a > b ? a : b;
	return max;
}

template < typename T1, typename T2 >
auto min( T1 a, T2 b ) {
	auto min = a < b ? a : b;
	return min;
}

template < typename T1, typename T2 >
void updmax( T1 & a, T2 b ) { a = a > b ? a : b; }

template < typename T1, typename T2 >
void updmin( T1 & a, T2 b ) { a = a < b ? a : b; }

const double EPS = 1e-9;
const double PI = acos( -1. );
const int mod = 1e9 + 7;
int inf = __INT64_MAX__;
string YN[] = { "NO", "YES" };

#define gcd( a, b ) __gcd(a, b)
#define lcm( a, b ) ((a)*((b)/gcd(a,b)))

inline int gcd_e( int a, int b, int & x, int & y ) {
	if( !a ) {
		x = 0;
		y = 1;
		return b;
	}
	int x1, y1;
	int d = gcd_e( b % a, a, x1, y1 );
	x = y1 - ( b / a ) * x1;
	y = x1;
	return d;
}

inline int div_mod( int a, int b, int m = mod ) {
	int x, y;
	int g = gcd_e( b, m, x, y );
	x = ( x % m + m ) % m;
	return ( a * x ) % m;
}

int pow_mod( int a, int n, int m = mod ) {
	int res = 1;
	while( n ) {
		if( n & 1 )
			res = ( res * a ) % m;
		a = ( a * a ) % m;
		n >>= 1;
	}
	return res;
}

int px[] = { 1, -1, 0, 0 };
int py[] = { 0, 0, -1, 1 };
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };

//tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> tr;

static const int MAXN = 1 << 20;
static int a[MAXN], b[MAXN];

int n, m, k;
int res, ans, cnt;
string s;

int used[MAXN];

int f( int x, int a, int b, int dx ) {
	used[dx] = 1;
	if( dx > x ) return 0;
	if( !used[dx + a] )
		f( x, a, b, dx + a );
	if( dx - a >= 0 && !used[dx - b] )
		f( x, a, b, dx - b );

}

void solution( ) {
	cin >> n;
	cout << "1 " << n - 1 << " ";
	for( int i = 1; i <= n; i++ ) cout << i << " ";
	cout << endl;
	int x;
	cin >> x;
	int l = 1, r = n + 1;
	while( r - l > 1 ) {
		int m = ( r + l ) >> 1;
		cout << "1 " << m << " ";
		for( int i = 1; i <= m; i++ ) cout << i << " ";
		cout << endl;
		int y;
		cin >> y;
		if( y == x ) {
			r = m;
		} else {
			l = m;
		}
	}
	cout << 1 << " " << n - 1 << " ";
	cout << r << " ";
	for( int i = 1; i <= n; i++ ) {
		if( r == i ) {
			continue;
		}
		cout << i << " ";
	}
	cout << endl;
	cin >> x;
	cout << "-1" << " " << x << endl;
}

int32_t main( ) {

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	ios_base::sync_with_stdio( false );
	cin.tie( nullptr );
	cout.tie( nullptr );
	//cout.precision(15);

	int query = 1;
	cin >> query;

	while( query-- ) solution();

	return 0;

}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <random>
#include <iomanip>

#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#include <deque>
#include <array>
#include <iterator>
#include <bitset>
#include <initializer_list>

using namespace std;

#include <ext/rope>

using namespace __gnu_cxx;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define int long long

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

#define add push_back
#define rem pop_back
#define ALL( x ) x.begin(), x.end()
#define SORT( x ) sort(ALL(x))
#define REV( x ) reverse(ALL(x))
#define F first
#define S second
#define DEBUG( x ) cout << #x << " " << x << endl;
#define forn( i, a, b ) for(int i = a; i <= b; i++)

template < typename T1, typename T2 >
auto max( T1 a, T2 b ) {
	auto max = a > b ? a : b;
	return max;
}

template < typename T1, typename T2 >
auto min( T1 a, T2 b ) {
	auto min = a < b ? a : b;
	return min;
}

template < typename T1, typename T2 >
void updmax( T1 & a, T2 b ) { a = a > b ? a : b; }

template < typename T1, typename T2 >
void updmin( T1 & a, T2 b ) { a = a < b ? a : b; }

const double EPS = 1e-9;
const double PI = acos( -1. );
const int mod = 1e9 + 7;
int inf = __INT64_MAX__;
string YN[] = { "NO", "YES" };

#define gcd( a, b ) __gcd(a, b)
#define lcm( a, b ) ((a)*((b)/gcd(a,b)))

inline int gcd_e( int a, int b, int & x, int & y ) {
	if( !a ) {
		x = 0;
		y = 1;
		return b;
	}
	int x1, y1;
	int d = gcd_e( b % a, a, x1, y1 );
	x = y1 - ( b / a ) * x1;
	y = x1;
	return d;
}

inline int div_mod( int a, int b, int m = mod ) {
	int x, y;
	int g = gcd_e( b, m, x, y );
	x = ( x % m + m ) % m;
	return ( a * x ) % m;
}

int pow_mod( int a, int n, int m = mod ) {
	int res = 1;
	while( n ) {
		if( n & 1 )
			res = ( res * a ) % m;
		a = ( a * a ) % m;
		n >>= 1;
	}
	return res;
}

int px[] = { 1, -1, 0, 0 };
int py[] = { 0, 0, -1, 1 };
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };

//tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> tr;

static const int MAXN = 1 << 20;
static int a[MAXN], b[MAXN];

int n, m, k;
int res, ans, cnt;
string s;

int used[MAXN];

int ask( int l1, int r1, int l2, int r2 ) {
	cout << r1 - l1 + 1 << " " << r2 - l2 + 1 << " ";
	for( int i = l1; i <= r1; i++ ) {
		cout << i << " ";
	}
	for( int i = l2; i <= r2; i++ ) {
		cout << i << " ";
	}
	cout << endl;
	int x;
	cin >> x;
	if( x == -1 ) {
		exit( 0 );
	}
	return x;
}

void solution( ) {
	cin >> n;
	int x = ask( 1, 1, 2, n );
	int l = 1, r = n;
	while( r - l > 1 ) {
		int mid = ( r + l ) >> 1;
		if( ask( 1, 1, 2, mid ) == x ) {
			r = mid;
		} else {
			l = mid;
		}
	}
	cout << 1 << " " << n - 1 << " ";
	cout << r << " ";
	for( int i = 1; i <= n; i++ ) {
		if( r == i ) {
			continue;
		}
		cout << i << " ";
	}
	cout << endl;
	cin >> n;
	if( x == -1 ) {
		return;
	}
	cout << "-1 " << x << endl;
}

int32_t main( ) {

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	ios_base::sync_with_stdio( false );
	cin.tie( nullptr );
	cout.tie( nullptr );
	//cout.precision(15);

	int query = 1;
	cin >> query;

	while( query-- ) solution();

	return 0;

}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <random>
#include <iomanip>

#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#include <deque>
#include <array>
#include <iterator>
#include <bitset>
#include <initializer_list>

using namespace std;

#include <ext/rope>

using namespace __gnu_cxx;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define int long long

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

#define add push_back
#define rem pop_back
#define ALL( x ) x.begin(), x.end()
#define SORT( x ) sort(ALL(x))
#define REV( x ) reverse(ALL(x))
#define F first
#define S second
#define DEBUG( x ) cout << #x << " " << x << endl;
#define forn( i, a, b ) for(int i = a; i <= b; i++)

template < typename T1, typename T2 >
auto max( T1 a, T2 b ) {
	auto max = a > b ? a : b;
	return max;
}

template < typename T1, typename T2 >
auto min( T1 a, T2 b ) {
	auto min = a < b ? a : b;
	return min;
}

template < typename T1, typename T2 >
void updmax( T1 & a, T2 b ) { a = a > b ? a : b; }

template < typename T1, typename T2 >
void updmin( T1 & a, T2 b ) { a = a < b ? a : b; }

const double EPS = 1e-9;
const double PI = acos( -1. );
const int mod = 1e9 + 7;
int inf = __INT64_MAX__;
string YN[] = { "NO", "YES" };

#define gcd( a, b ) __gcd(a, b)
#define lcm( a, b ) ((a)*((b)/gcd(a,b)))

inline int gcd_e( int a, int b, int & x, int & y ) {
	if( !a ) {
		x = 0;
		y = 1;
		return b;
	}
	int x1, y1;
	int d = gcd_e( b % a, a, x1, y1 );
	x = y1 - ( b / a ) * x1;
	y = x1;
	return d;
}

inline int div_mod( int a, int b, int m = mod ) {
	int x, y;
	int g = gcd_e( b, m, x, y );
	x = ( x % m + m ) % m;
	return ( a * x ) % m;
}

int pow_mod( int a, int n, int m = mod ) {
	int res = 1;
	while( n ) {
		if( n & 1 )
			res = ( res * a ) % m;
		a = ( a * a ) % m;
		n >>= 1;
	}
	return res;
}

int px[] = { 1, -1, 0, 0 };
int py[] = { 0, 0, -1, 1 };
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };

//tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> tr;

static const int MAXN = 1 << 20;
static int a[MAXN], b[MAXN];

int n, m, k;
int res, ans, cnt;
string s;

int used[MAXN];

int f( int x, int a, int b, int dx ) {
	used[dx] = 1;
	if( dx > x ) return 0;
	if( !used[dx + a] )
		f( x, a, b, dx + a );
	if( dx - a >= 0 && !used[dx - b] )
		f( x, a, b, dx - b );

}

void solution( ) {
	cin >> n;
	cout << "1 " << n - 1 << " 1 ";
	for( int i = 2; i <= n; i++ ) cout << i << " ";
	cout << endl;
	int x;
	cin >> x;
	int l = 1, r = n + 1;
	while( r - l > 1 ) {
		int m = ( r + l ) >> 1;
		cout << "1 " << m << " 1 ";
		for( int i = 2; i <= m; i++ ) cout << i << " ";
		cout << endl;
		int y;
		cin >> y;
		if( y == x ) {
			r = m;
		} else {
			l = m;
		}
	}
	cout << 1 << " " << n - 1 << " ";
	cout << r << " ";
	for( int i = 1; i <= n; i++ ) {
		if( r == i ) {
			continue;
		}
		cout << i << " ";
	}
	cin >> x;
	cout << " -1" << " " <<x << endl;
}

int32_t main( ) {

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	ios_base::sync_with_stdio( false );
	cin.tie( nullptr );
	cout.tie( nullptr );
	//cout.precision(15);

	int query = 1;
	//cin >> query;

	while( query-- ) solution();

	return 0;

}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <random>
#include <iomanip>

#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#include <deque>
#include <array>
#include <iterator>
#include <bitset>
#include <initializer_list>

using namespace std;

#include <ext/rope>

using namespace __gnu_cxx;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define int long long

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

#define add push_back
#define rem pop_back
#define ALL( x ) x.begin(), x.end()
#define SORT( x ) sort(ALL(x))
#define REV( x ) reverse(ALL(x))
#define F first
#define S second
#define DEBUG( x ) cout << #x << " " << x << endl;
#define forn( i, a, b ) for(int i = a; i <= b; i++)

template < typename T1, typename T2 >
auto max( T1 a, T2 b ) {
	auto max = a > b ? a : b;
	return max;
}

template < typename T1, typename T2 >
auto min( T1 a, T2 b ) {
	auto min = a < b ? a : b;
	return min;
}

template < typename T1, typename T2 >
void updmax( T1 & a, T2 b ) { a = a > b ? a : b; }

template < typename T1, typename T2 >
void updmin( T1 & a, T2 b ) { a = a < b ? a : b; }

const double EPS = 1e-9;
const double PI = acos( -1. );
const int mod = 1e9 + 7;
int inf = __INT64_MAX__;
string YN[] = { "NO", "YES" };

#define gcd( a, b ) __gcd(a, b)
#define lcm( a, b ) ((a)*((b)/gcd(a,b)))

inline int gcd_e( int a, int b, int & x, int & y ) {
	if( !a ) {
		x = 0;
		y = 1;
		return b;
	}
	int x1, y1;
	int d = gcd_e( b % a, a, x1, y1 );
	x = y1 - ( b / a ) * x1;
	y = x1;
	return d;
}

inline int div_mod( int a, int b, int m = mod ) {
	int x, y;
	int g = gcd_e( b, m, x, y );
	x = ( x % m + m ) % m;
	return ( a * x ) % m;
}

int pow_mod( int a, int n, int m = mod ) {
	int res = 1;
	while( n ) {
		if( n & 1 )
			res = ( res * a ) % m;
		a = ( a * a ) % m;
		n >>= 1;
	}
	return res;
}

int px[] = { 1, -1, 0, 0 };
int py[] = { 0, 0, -1, 1 };
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };

//tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> tr;

static const int MAXN = 1 << 20;
static int a[MAXN], b[MAXN];

int n, m, k;
int res, ans, cnt;
string s;

int used[MAXN];

int f( int x, int a, int b, int dx ) {
	used[dx] = 1;
	if( dx > x ) return 0;
	if( !used[dx + a] )
		f( x, a, b, dx + a );
	if( dx - a >= 0 && !used[dx - b] )
		f( x, a, b, dx - b );

}

void solution( ) {
	cin >> n;
	cout << "1 " << n - 1 << " 1 ";
	for( int i = 2; i <= n; i++ ) cout << i << " ";
	cout << endl;
	int x;
	cin >> x;
	int l = 1, r = n + 1;
	while( r - l > 1 ) {
		int m = ( r + l ) >> 1;
		cout << "1 " << m << " 1 ";
		for( int i = 2; i <= m; i++ ) cout << i << " ";
		cout << endl;
		int y;
		cin >> y;
		if( y == x ) {
			r = m;
		} else {
			l = m;
		}
	}
	cout << 1 << " " << n - 1 << " ";
	cout << r << " ";
	for( int i = 1; i <= n; i++ ) {
		if( r == i ) {
			continue;
		}
		cout << i << " ";
	}
	cout << endl;
	cin >> x;
	cout << "-1" << " " << x << endl;
}

int32_t main( ) {

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	ios_base::sync_with_stdio( false );
	cin.tie( nullptr );
	cout.tie( nullptr );
	//cout.precision(15);

	int query = 1;
	cin >> query;

	while( query-- ) solution();

	return 0;

}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <random>
#include <iomanip>

#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#include <deque>
#include <array>
#include <iterator>
#include <bitset>
#include <initializer_list>

using namespace std;

#include <ext/rope>

using namespace __gnu_cxx;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define int long long

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

#define add push_back
#define rem pop_back
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REV(x) reverse(ALL(x))
#define F first
#define S second
#define DEBUG(x) cout << #x << " " << x << endl;
#define forn(i, a, b) for(int i = a; i <= b; i++)

template<typename T1, typename T2> auto max ( T1 a, T2 b ) { auto max = a > b ? a : b; return max; }
template<typename T1, typename T2> auto min ( T1 a, T2 b ) { auto min = a < b ? a : b; return min; }
template<typename T1, typename T2> void updmax ( T1 &a, T2 b ) { a = a > b ? a : b; }
template<typename T1, typename T2> void updmin ( T1 &a, T2 b ) { a = a < b ? a : b; }

const double EPS = 1e-9;
const double PI = acos ( -1. );
const int mod = 1e9 + 7;
int inf = __INT64_MAX__;
string YN[] = {"NO", "YES"};

#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) ((a)*((b)/gcd(a,b)))

inline int gcd_e( int a, int b, int & x, int & y )
{
        if ( !a ) {
                x = 0;
                y = 1;
                return b;
        }
        int x1, y1;
        int d = gcd_e ( b % a, a, x1, y1 );
        x = y1 - ( b / a ) * x1;
        y = x1;
        return d;
}

inline int div_mod( int a, int b, int m = mod )
{
        int x, y;
        int g = gcd_e( b, m, x, y );
        x = ( x % m + m ) % m;
        return ( a * x ) % m;
}

int pow_mod ( int a, int n, int m = mod )
{
        int res = 1;
        while ( n ) {
                if ( n & 1 )
                        res = ( res * a ) % m;
                a = ( a * a ) % m;
                n >>= 1;
        }
        return res;
}

int px[] = { 1, -1, 0, 0 };
int py[] = { 0, 0, -1, 1 };
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };

//tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> tr;

static const int MAXN = 1 << 20;
static int a[MAXN], b[MAXN];

int n, m, k;
int res, ans, cnt;
string s;

void solution()
{

}

int32_t main ( )
{

        //freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);

        ios_base::sync_with_stdio ( false ); cin.tie ( nullptr ); cout.tie ( nullptr );
        //cout.precision(15);

        int query = 1;
        cin >> query;

        while ( query-- ) solution();

        return 0;

}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <random>
#include <iomanip>

#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#include <deque>
#include <array>
#include <iterator>
#include <bitset>
#include <initializer_list>

using namespace std;

#include <ext/rope>

using namespace __gnu_cxx;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define int long long

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

#define add push_back
#define rem pop_back
#define ALL( x ) x.begin(), x.end()
#define SORT( x ) sort(ALL(x))
#define REV( x ) reverse(ALL(x))
#define F first
#define S second
#define DEBUG( x ) cout << #x << " " << x << endl;
#define forn( i, a, b ) for(int i = a; i <= b; i++)

template < typename T1, typename T2 >
auto max( T1 a, T2 b ) {
	auto max = a > b ? a : b;
	return max;
}

template < typename T1, typename T2 >
auto min( T1 a, T2 b ) {
	auto min = a < b ? a : b;
	return min;
}

template < typename T1, typename T2 >
void updmax( T1 & a, T2 b ) { a = a > b ? a : b; }

template < typename T1, typename T2 >
void updmin( T1 & a, T2 b ) { a = a < b ? a : b; }

const double EPS = 1e-9;
const double PI = acos( -1. );
const int mod = 1e9 + 7;
int inf = __INT64_MAX__;
string YN[] = { "NO", "YES" };

#define gcd( a, b ) __gcd(a, b)
#define lcm( a, b ) ((a)*((b)/gcd(a,b)))

inline int gcd_e( int a, int b, int & x, int & y ) {
	if( !a ) {
		x = 0;
		y = 1;
		return b;
	}
	int x1, y1;
	int d = gcd_e( b % a, a, x1, y1 );
	x = y1 - ( b / a ) * x1;
	y = x1;
	return d;
}

inline int div_mod( int a, int b, int m = mod ) {
	int x, y;
	int g = gcd_e( b, m, x, y );
	x = ( x % m + m ) % m;
	return ( a * x ) % m;
}

int pow_mod( int a, int n, int m = mod ) {
	int res = 1;
	while( n ) {
		if( n & 1 )
			res = ( res * a ) % m;
		a = ( a * a ) % m;
		n >>= 1;
	}
	return res;
}

int px[] = { 1, -1, 0, 0 };
int py[] = { 0, 0, -1, 1 };
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };

//tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> tr;

static const int MAXN = 1 << 20;
static int a[MAXN], b[MAXN];

int n, m, k;
int res, ans, cnt;
string s;

int used[MAXN];

int ask( int l1, int r1, int l2, int r2 ) {
	cout << r1 - l1 + 1 << " " << r2 - l2 + 1 << " ";
	for( int i = l1; i <= r1; i++ ) {
		cout << i << " ";
	}
	for( int i = l2; i <= r2; i++ ) {
		cout << i << " ";
	}
	cout << endl;
	int x;
	cin >> x;
	if( x == -1 ) {
		exit( 0 );
	}
	return x;
}

void solution( ) {
	cin >> n;
	int x = ask( 1, 1, 2, n );
	int l = 1, r = n + 1;
	while( r - l > 1 ) {
		int mid = ( r + l ) >> 1;
		if( ask( 1, 1, 2, mid ) == x ) {
			r = mid;
		} else {
			l = mid;
		}
	}
	cout << 1 << " " << n - 1 << " ";
	cout << r << " ";
	for( int i = 1; i <= n; i++ ) {
		if( r == i ) {
			continue;
		}
		cout << i << " ";
	}
	cout << endl;
	cin >> n;
	if( x == -1 ) {
		return;
	}
	cout << "-1 " << x << endl;
}

int32_t main( ) {

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	ios_base::sync_with_stdio( false );
	cin.tie( nullptr );
	cout.tie( nullptr );
	//cout.precision(15);

	int query = 1;
	cin >> query;

	while( query-- ) solution();

	return 0;

}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <random>
#include <iomanip>

#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#include <deque>
#include <array>
#include <iterator>
#include <bitset>
#include <initializer_list>

using namespace std;

#include <ext/rope>

using namespace __gnu_cxx;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define int long long

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

#define add push_back
#define rem pop_back
#define ALL( x ) x.begin(), x.end()
#define SORT( x ) sort(ALL(x))
#define REV( x ) reverse(ALL(x))
#define F first
#define S second
#define DEBUG( x ) cout << #x << " " << x << endl;
#define forn( i, a, b ) for(int i = a; i <= b; i++)

template < typename T1, typename T2 >
auto max( T1 a, T2 b ) {
	auto max = a > b ? a : b;
	return max;
}

template < typename T1, typename T2 >
auto min( T1 a, T2 b ) {
	auto min = a < b ? a : b;
	return min;
}

template < typename T1, typename T2 >
void updmax( T1 & a, T2 b ) { a = a > b ? a : b; }

template < typename T1, typename T2 >
void updmin( T1 & a, T2 b ) { a = a < b ? a : b; }

const double EPS = 1e-9;
const double PI = acos( -1. );
const int mod = 1e9 + 7;
int inf = __INT64_MAX__;
string YN[] = { "NO", "YES" };

#define gcd( a, b ) __gcd(a, b)
#define lcm( a, b ) ((a)*((b)/gcd(a,b)))

inline int gcd_e( int a, int b, int & x, int & y ) {
	if( !a ) {
		x = 0;
		y = 1;
		return b;
	}
	int x1, y1;
	int d = gcd_e( b % a, a, x1, y1 );
	x = y1 - ( b / a ) * x1;
	y = x1;
	return d;
}

inline int div_mod( int a, int b, int m = mod ) {
	int x, y;
	int g = gcd_e( b, m, x, y );
	x = ( x % m + m ) % m;
	return ( a * x ) % m;
}

int pow_mod( int a, int n, int m = mod ) {
	int res = 1;
	while( n ) {
		if( n & 1 )
			res = ( res * a ) % m;
		a = ( a * a ) % m;
		n >>= 1;
	}
	return res;
}

int px[] = { 1, -1, 0, 0 };
int py[] = { 0, 0, -1, 1 };
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };

//tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> tr;

static const int MAXN = 1 << 20;
static int a[MAXN], b[MAXN];

int n, m, k;
int res, ans, cnt;
string s;

int used[MAXN];

int f( int x, int a, int b, int dx ) {
	used[dx] = 1;
	if( dx > x ) return 0;
	if( !used[dx + a] )
		f( x, a, b, dx + a );
	if( dx - a >= 0 && !used[dx - b] )
		f( x, a, b, dx - b );

}

void solution( ) {
	cin >> n;
	cout << "1 " << n - 1 << " 1 ";
	for( int i = 2; i <= n; i++ ) cout << i << " ";
	cout << endl;
	int x;
	cin >> x;
	int l = 1, r = n + 1;
	while( r - l > 1 ) {
		int m = ( r + l ) >> 1;
		cout << "1 " << m << " 1 ";
		for( int i = 2; i <= m; i++ ) cout << i << " ";
		cout << endl;
		int y;
		cin >> y;
		if( y == x ) {
			r = m;
		} else {
			l = m;
		}
	}
	cout << 1 << " " << n - 1 << " ";
	cout << r << " ";
	for( int i = 1; i <= n; i++ ) {
		if( r == i ) {
			continue;
		}
		cout << i << " ";
	}
	cin >> x;
	cout << " -1" << " " <<a x << endl;
}

int32_t main( ) {

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	ios_base::sync_with_stdio( false );
	cin.tie( nullptr );
	cout.tie( nullptr );
	//cout.precision(15);

	int query = 1;
	//cin >> query;

	while( query-- ) solution();

	return 0;

}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <random>
#include <iomanip>

#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#include <deque>
#include <array>
#include <iterator>
#include <bitset>
#include <initializer_list>

using namespace std;

#include <ext/rope>

using namespace __gnu_cxx;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define int long long

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

#define add push_back
#define rem pop_back
#define ALL( x ) x.begin(), x.end()
#define SORT( x ) sort(ALL(x))
#define REV( x ) reverse(ALL(x))
#define F first
#define S second
#define DEBUG( x ) cout << #x << " " << x << endl;
#define forn( i, a, b ) for(int i = a; i <= b; i++)

template < typename T1, typename T2 >
auto max( T1 a, T2 b ) {
	auto max = a > b ? a : b;
	return max;
}

template < typename T1, typename T2 >
auto min( T1 a, T2 b ) {
	auto min = a < b ? a : b;
	return min;
}

template < typename T1, typename T2 >
void updmax( T1 & a, T2 b ) { a = a > b ? a : b; }

template < typename T1, typename T2 >
void updmin( T1 & a, T2 b ) { a = a < b ? a : b; }

const double EPS = 1e-9;
const double PI = acos( -1. );
const int mod = 1e9 + 7;
int inf = __INT64_MAX__;
string YN[] = { "NO", "YES" };

#define gcd( a, b ) __gcd(a, b)
#define lcm( a, b ) ((a)*((b)/gcd(a,b)))

inline int gcd_e( int a, int b, int & x, int & y ) {
	if( !a ) {
		x = 0;
		y = 1;
		return b;
	}
	int x1, y1;
	int d = gcd_e( b % a, a, x1, y1 );
	x = y1 - ( b / a ) * x1;
	y = x1;
	return d;
}

inline int div_mod( int a, int b, int m = mod ) {
	int x, y;
	int g = gcd_e( b, m, x, y );
	x = ( x % m + m ) % m;
	return ( a * x ) % m;
}

int pow_mod( int a, int n, int m = mod ) {
	int res = 1;
	while( n ) {
		if( n & 1 )
			res = ( res * a ) % m;
		a = ( a * a ) % m;
		n >>= 1;
	}
	return res;
}

int px[] = { 1, -1, 0, 0 };
int py[] = { 0, 0, -1, 1 };
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };

//tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> tr;

static const int MAXN = 1 << 20;
static int a[MAXN], b[MAXN];

int n, m, k;
int res, ans, cnt;
string s;

int used[MAXN];

int f( int x, int a, int b, int dx ) {
	used[dx] = 1;
	if( dx > x ) return 0;
	if( !used[dx + a] )
		f( x, a, b, dx + a );
	if( dx - a >= 0 && !used[dx - b] )
		f( x, a, b, dx - b );

}

void solution( ) {
	cin >> n;
	cout << "1 " << n - 1 << " 1 ";
	for( int i = 2; i <= n; i++ ) cout << i << " ";
	cout << endl;
	int x;
	cin >> x;
	int l = 1, r = n + 1;
	while( r - l > 1 ) {
		int m = ( r + l ) >> 1;
		cout << "1 " << m << " 1 ";
		for( int i = 2; i <= m; i++ ) cout << i << " ";
		cout << endl;
		int y;
		cin >> y;
		if( y == x ) {
			r = m;
		} else {
			l = m;
		}
	}
	cout << 1 << " " << n - 1 << " ";
	cout << r << " ";
	for( int i = 1; i <= n; i++ ) {
		if( r == i ) {
			continue;
		}
		cout << i << " ";
	}
	cout << endl;
	cin >> x;
	cout << "-1 " << " " << x << endl;
}

int32_t main( ) {

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	ios_base::sync_with_stdio( false );
	cin.tie( nullptr );
	cout.tie( nullptr );
	//cout.precision(15);

	int query = 1;
	//cin >> query;

	while( query-- ) solution();

	return 0;

}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <random>
#include <iomanip>

#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#include <deque>
#include <array>
#include <iterator>
#include <bitset>
#include <initializer_list>

using namespace std;

#include <ext/rope>

using namespace __gnu_cxx;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define int long long

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

#define add push_back
#define rem pop_back
#define ALL( x ) x.begin(), x.end()
#define SORT( x ) sort(ALL(x))
#define REV( x ) reverse(ALL(x))
#define F first
#define S second
#define DEBUG( x ) cout << #x << " " << x << endl;
#define forn( i, a, b ) for(int i = a; i <= b; i++)

template < typename T1, typename T2 >
auto max( T1 a, T2 b ) {
	auto max = a > b ? a : b;
	return max;
}

template < typename T1, typename T2 >
auto min( T1 a, T2 b ) {
	auto min = a < b ? a : b;
	return min;
}

template < typename T1, typename T2 >
void updmax( T1 & a, T2 b ) { a = a > b ? a : b; }

template < typename T1, typename T2 >
void updmin( T1 & a, T2 b ) { a = a < b ? a : b; }

const double EPS = 1e-9;
const double PI = acos( -1. );
const int mod = 1e9 + 7;
int inf = __INT64_MAX__;
string YN[] = { "NO", "YES" };

#define gcd( a, b ) __gcd(a, b)
#define lcm( a, b ) ((a)*((b)/gcd(a,b)))

inline int gcd_e( int a, int b, int & x, int & y ) {
	if( !a ) {
		x = 0;
		y = 1;
		return b;
	}
	int x1, y1;
	int d = gcd_e( b % a, a, x1, y1 );
	x = y1 - ( b / a ) * x1;
	y = x1;
	return d;
}

inline int div_mod( int a, int b, int m = mod ) {
	int x, y;
	int g = gcd_e( b, m, x, y );
	x = ( x % m + m ) % m;
	return ( a * x ) % m;
}

int pow_mod( int a, int n, int m = mod ) {
	int res = 1;
	while( n ) {
		if( n & 1 )
			res = ( res * a ) % m;
		a = ( a * a ) % m;
		n >>= 1;
	}
	return res;
}

int px[] = { 1, -1, 0, 0 };
int py[] = { 0, 0, -1, 1 };
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };

//tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> tr;

static const int MAXN = 1 << 20;
static int a[MAXN], b[MAXN];

int n, m, k;
int res, ans, cnt;
string s;

int used[MAXN];

int ask( int l1, int r1, int l2, int r2 ) {
	cout << r1 - l1 + 1 << " " << r2 - l2 + 1 << " ";
	for( int i = l1; i <= r1; i++ ) {
		cout << i << " ";
	}
	for( int i = l2; i <= r2; i++ ) {
		cout << i << " ";
	}
	cout << endl;
	cout.flush();
//    fflush(stdout);
	int x;
	cin >> x;
	if( x == -1 ) {
		exit( 0 );
	}
	return x;
}

void solution( ) {
	cin >> n;
	int x = ask( 1, 1, 2, n );
	int l = 1, r = n + 1;
	while( r - l > 1 ) {
		int mid = ( r + l ) >> 1;
		if( ask( 1, 1, 2, mid ) == x ) {
			r = mid;
		} else {
			l = mid;
		}
	}
	cout << 1 << " " << n - 1 << " ";
	cout << r << " ";
	for( int i = 1; i <= n; i++ ) {
		if( r == i ) {
			continue;
		}
		cout << i << " ";
	}
	cout << "\n";
	cout.flush();
	cin >> x;
	if( x == -1 ) {
		return 0;
	}
	cout << "-1 " << x << "\n";
	cout.flush();
}

int32_t main( ) {

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	ios_base::sync_with_stdio( false );
	cin.tie( nullptr );
	cout.tie( nullptr );
	//cout.precision(15);

	int query = 1;
	cin >> query;

	while( query-- ) solution();

	return 0;

}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <random>
#include <iomanip>

#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#include <deque>
#include <array>
#include <iterator>
#include <bitset>
#include <initializer_list>

using namespace std;

#include <ext/rope>

using namespace __gnu_cxx;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define int long long

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

#define add push_back
#define rem pop_back
#define ALL( x ) x.begin(), x.end()
#define SORT( x ) sort(ALL(x))
#define REV( x ) reverse(ALL(x))
#define F first
#define S second
#define DEBUG( x ) cout << #x << " " << x << endl;
#define forn( i, a, b ) for(int i = a; i <= b; i++)

template < typename T1, typename T2 >
auto max( T1 a, T2 b ) {
	auto max = a > b ? a : b;
	return max;
}

template < typename T1, typename T2 >
auto min( T1 a, T2 b ) {
	auto min = a < b ? a : b;
	return min;
}

template < typename T1, typename T2 >
void updmax( T1 & a, T2 b ) { a = a > b ? a : b; }

template < typename T1, typename T2 >
void updmin( T1 & a, T2 b ) { a = a < b ? a : b; }

const double EPS = 1e-9;
const double PI = acos( -1. );
const int mod = 1e9 + 7;
int inf = __INT64_MAX__;
string YN[] = { "NO", "YES" };

#define gcd( a, b ) __gcd(a, b)
#define lcm( a, b ) ((a)*((b)/gcd(a,b)))

inline int gcd_e( int a, int b, int & x, int & y ) {
	if( !a ) {
		x = 0;
		y = 1;
		return b;
	}
	int x1, y1;
	int d = gcd_e( b % a, a, x1, y1 );
	x = y1 - ( b / a ) * x1;
	y = x1;
	return d;
}

inline int div_mod( int a, int b, int m = mod ) {
	int x, y;
	int g = gcd_e( b, m, x, y );
	x = ( x % m + m ) % m;
	return ( a * x ) % m;
}

int pow_mod( int a, int n, int m = mod ) {
	int res = 1;
	while( n ) {
		if( n & 1 )
			res = ( res * a ) % m;
		a = ( a * a ) % m;
		n >>= 1;
	}
	return res;
}

int px[] = { 1, -1, 0, 0 };
int py[] = { 0, 0, -1, 1 };
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };

//tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> tr;

static const int MAXN = 1 << 20;
static int a[MAXN], b[MAXN];

int n, m, k;
int res, ans, cnt;
string s;

int used[MAXN];

int ask( int l1, int r1, int l2, int r2 ) {
	cout << r1 - l1 + 1 << " " << r2 - l2 + 1 << " ";
	for( int i = l1; i <= r1; i++ ) {
		cout << i << " ";
	}
	for( int i = l2; i <= r2; i++ ) {
		cout << i << " ";
	}
	cout << endl;
	int x;
	cin >> x;
	if( x == -1 ) {
		exit( 0 );
	}
	return x;
}

void solution( ) {
	cin >> n;
	int x = ask( 1, 1, 2, n );
	int l = 1, r = n + 1;
	while( r - l > 1 ) {
		int mid = ( r + l ) >> 1;
		if( ask( 1, 1, 2, mid ) == x ) {
			r = mid;
		} else {
			l = mid;
		}
	}
	cout << 1 << " " << n - 1 << " ";
	cout << r << " ";
	for( int i = 1; i <= n; i++ ) {
		if( r == i ) {
			continue;
		}
		cout << i << " ";
	}
	cout << endl;
	cin >> n;
	if( x == -1 ) {
		return 0;
	}
	cout << "-1 " << x << endl;
}

int32_t main( ) {

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	ios_base::sync_with_stdio( false );
	cin.tie( nullptr );
	cout.tie( nullptr );
	//cout.precision(15);

	int query = 1;
	cin >> query;

	while( query-- ) solution();

	return 0;

}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <random>
#include <iomanip>

#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#include <deque>
#include <array>
#include <iterator>
#include <bitset>
#include <initializer_list>

using namespace std;

#include <ext/rope>

using namespace __gnu_cxx;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define int long long

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

#define add push_back
#define rem pop_back
#define ALL( x ) x.begin(), x.end()
#define SORT( x ) sort(ALL(x))
#define REV( x ) reverse(ALL(x))
#define F first
#define S second
#define DEBUG( x ) cout << #x << " " << x << endl;
#define forn( i, a, b ) for(int i = a; i <= b; i++)

template < typename T1, typename T2 >
auto max( T1 a, T2 b ) {
	auto max = a > b ? a : b;
	return max;
}

template < typename T1, typename T2 >
auto min( T1 a, T2 b ) {
	auto min = a < b ? a : b;
	return min;
}

template < typename T1, typename T2 >
void updmax( T1 & a, T2 b ) { a = a > b ? a : b; }

template < typename T1, typename T2 >
void updmin( T1 & a, T2 b ) { a = a < b ? a : b; }

const double EPS = 1e-9;
const double PI = acos( -1. );
const int mod = 1e9 + 7;
int inf = __INT64_MAX__;
string YN[] = { "NO", "YES" };

#define gcd( a, b ) __gcd(a, b)
#define lcm( a, b ) ((a)*((b)/gcd(a,b)))

inline int gcd_e( int a, int b, int & x, int & y ) {
	if( !a ) {
		x = 0;
		y = 1;
		return b;
	}
	int x1, y1;
	int d = gcd_e( b % a, a, x1, y1 );
	x = y1 - ( b / a ) * x1;
	y = x1;
	return d;
}

inline int div_mod( int a, int b, int m = mod ) {
	int x, y;
	int g = gcd_e( b, m, x, y );
	x = ( x % m + m ) % m;
	return ( a * x ) % m;
}

int pow_mod( int a, int n, int m = mod ) {
	int res = 1;
	while( n ) {
		if( n & 1 )
			res = ( res * a ) % m;
		a = ( a * a ) % m;
		n >>= 1;
	}
	return res;
}

int px[] = { 1, -1, 0, 0 };
int py[] = { 0, 0, -1, 1 };
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };

//tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> tr;

static const int MAXN = 1 << 20;
static int a[MAXN], b[MAXN];

int n, m, k;
int res, ans, cnt;
string s;

int used[MAXN];

int f( int x, int a, int b, int dx ) {
	used[dx] = 1;
	if( dx > x ) return 0;
	if( !used[dx + a] )
		f( x, a, b, dx + a );
	if( dx - a >= 0 && !used[dx - b] )
		f( x, a, b, dx - b );

}

void solution( ) {
	cin >> n;
	cout << "1 " << n - 1 << " 1 ";
	for( int i = 2; i <= n; i++ ) cout << i << " ";
	cout << endl;
	int x;
	cin >> x;
	int l = 1, r = n + 1;
	while( r - l > 1 ) {
		int m = ( r + l ) >> 1;
		cout << "1 " << m << " 1 ";
		for( int i = 2; i <= m; i++ ) cout << i << " ";
		cout << endl;
		int y;
		cin >> y;
		if( y == x ) {
			r = m;
		} else {
			l = m;
		}
	}
	cout << 1 << " " << n - 1 << " ";
	cout << r << " ";
	for( int i = 1; i <= n; i++ ) {
		if( r == i ) {
			continue;
		}
		cout << i << " ";
	}
	cout << endl;
	cin >> x;
	cout << "-1" << " " << x << endl;
}

int32_t main( ) {

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	ios_base::sync_with_stdio( false );
	cin.tie( nullptr );
	cout.tie( nullptr );
	//cout.precision(15);

	int query = 1;
	//cin >> query;

	while( query-- ) solution();

	return 0;

}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <random>
#include <iomanip>

#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#include <deque>
#include <array>
#include <iterator>
#include <bitset>
#include <initializer_list>

using namespace std;

#include <ext/rope>

using namespace __gnu_cxx;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define int long long

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;

#define add push_back
#define rem pop_back
#define ALL( x ) x.begin(), x.end()
#define SORT( x ) sort(ALL(x))
#define REV( x ) reverse(ALL(x))
#define F first
#define S second
#define DEBUG( x ) cout << #x << " " << x << endl;
#define forn( i, a, b ) for(int i = a; i <= b; i++)

template < typename T1, typename T2 >
auto max( T1 a, T2 b ) {
	auto max = a > b ? a : b;
	return max;
}

template < typename T1, typename T2 >
auto min( T1 a, T2 b ) {
	auto min = a < b ? a : b;
	return min;
}

template < typename T1, typename T2 >
void updmax( T1 & a, T2 b ) { a = a > b ? a : b; }

template < typename T1, typename T2 >
void updmin( T1 & a, T2 b ) { a = a < b ? a : b; }

const double EPS = 1e-9;
const double PI = acos( -1. );
const int mod = 1e9 + 7;
int inf = __INT64_MAX__;
string YN[] = { "NO", "YES" };

#define gcd( a, b ) __gcd(a, b)
#define lcm( a, b ) ((a)*((b)/gcd(a,b)))

inline int gcd_e( int a, int b, int & x, int & y ) {
	if( !a ) {
		x = 0;
		y = 1;
		return b;
	}
	int x1, y1;
	int d = gcd_e( b % a, a, x1, y1 );
	x = y1 - ( b / a ) * x1;
	y = x1;
	return d;
}

inline int div_mod( int a, int b, int m = mod ) {
	int x, y;
	int g = gcd_e( b, m, x, y );
	x = ( x % m + m ) % m;
	return ( a * x ) % m;
}

int pow_mod( int a, int n, int m = mod ) {
	int res = 1;
	while( n ) {
		if( n & 1 )
			res = ( res * a ) % m;
		a = ( a * a ) % m;
		n >>= 1;
	}
	return res;
}

int px[] = { 1, -1, 0, 0 };
int py[] = { 0, 0, -1, 1 };
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };

//tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> tr;

static const int MAXN = 1 << 20;
static int a[MAXN], b[MAXN];

int n, m, k;
int res, ans, cnt;
string s;

int used[MAXN];

int ask( int l1, int r1, int l2, int r2 ) {
	cout << r1 - l1 + 1 << " " << r2 - l2 + 1 << " ";
	for( int i = l1; i <= r1; i++ ) {
		cout << i << " ";
	}
	for( int i = l2; i <= r2; i++ ) {
		cout << i << " ";
	}
	cout << endl;
	cout.flush();
//    fflush(stdout);
	int x;
	cin >> x;
	if( x == -1 ) {
		exit( 0 );
	}
	return x;
}

void solution( ) {
	cin >> n;
	int x = ask( 1, 1, 2, n );
	int l = 1, r = n + 1;
	while( r - l > 1 ) {
		int mid = ( r + l ) >> 1;
		if( ask( 1, 1, 2, mid ) == x ) {
			r = mid;
		} else {
			l = mid;
		}
	}
	cout << 1 << " " << n - 1 << " ";
	cout << r << " ";
	for( int i = 1; i <= n; i++ ) {
		if( r == i ) {
			continue;
		}
		cout << i << " ";
	}
	cout << "\n";
	cout.flush();
	cin >> x;
	if( x == -1 ) {
		return;
	}
	cout << "-1 " << x << "\n";
	cout.flush();
}

int32_t main( ) {

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	ios_base::sync_with_stdio( false );
	cin.tie( nullptr );
	cout.tie( nullptr );
	//cout.precision(15);

	int query = 1;
	cin >> query;

	while( query-- ) solution();

	return 0;

}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define INF 987654321
int N,mx,tmp=INF,ans,pos,T;
int sol(int start,int end)
{
	if(start>end)
	return start;

	int mid=(start+end)/2;

	cout << 1 << " " << mid-start+1 << " ";

	cout << 1 << " ";
	for(int i=start; i<=mid; i++)
	cout << i << " ";
	cout << "\n";
	cout.flush();
	cin >> mx;
	if(tmp==INF)
	tmp=mx;

	if(mx==tmp)
	return sol(start,mid-1);
	else
	return sol(mid+1,end);
}
int main()
{
	ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

	cin >> T;
	while(T--)
	{
		tmp=INF;
		cin >> N;
		pos=sol(2,N);

		cout << 1 << " " << N-1 << " ";
		cout << pos << " ";
		for(int i=1; i<=N; i++)
		{
			if(i!=pos)
			cout << i << " ";
		}
		cout << "\n";
		cout.flush();
		cin >> ans;

		if(ans)
		cout << -1 << " " << ans << "\n";
		cout.flush();
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define INF 987654321
int N,mx,tmp=INF,ans,pos,T;
int sol(int start,int end)
{
	if(start>end)
	return start;

	int mid=(start+end)/2;

	cout << 1 << " " << mid-start+1 << " ";

	cout << 1 << " ";
	for(int i=start; i<=mid; i++)
	cout << i << " ";
	cout << "\n";
	cout.flush();
	cin >> mx;

	if(mx==tmp)
	return sol(start,mid-1);
	else
	return sol(mid+1,end);
}
int main()
{

	cin >> T;
	while(T--)
	{
		tmp=INF;
		cin >> N;
		cout << 1 << " " << N-1 << " ";

		for(int i=1; i<=N; i++)
		cout << i << " ";
		cout << "\n";
		cout.flush();
		cin >> mx;
		tmp=mx;
		pos=sol(2,N);

		cout << 1 << " " << N-1 << " ";
		cout << pos << " ";
		for(int i=1; i<=N; i++)
		{
			if(i!=pos)
			cout << i << " ";
		}
		cout << "\n";
		cout.flush();
		cin >> ans;

		cout << -1 << " " << ans << "\n";
		cout.flush(); //?
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define INF 987654321
int N,mx,tmp=INF,ans,pos,T;
int sol(int start,int end)
{
	if(start>end)
	return start;

	int mid=(start+end)/2;

	cout << 1 << " " << mid-start+1 << " ";

	cout << 1 << " ";
	for(int i=start; i<=mid; i++)
	cout << i << " ";
	cout << "\n";
	cout.flush();
	cin >> mx;
	if(tmp==INF)
	tmp=mx;

	if(mx==tmp)
	return sol(start,mid-1);
	else
	return sol(mid+1,end);
}
int main()
{
	ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

	cin >> T;
	while(T--)
	{
		tmp=INF;
		cin >> N;
		pos=sol(2,N);

		cout << 1 << " " << N-1 << " ";
		cout << pos << " ";
		for(int i=1; i<=N; i++)
		{
			if(i!=pos)
			cout << i << " ";
		}
		cout << "\n";
		cout.flush();
		cin >> ans;

		cout << -1 << " " << ans << "\n";
		cout.flush();
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int N,mx,tmp,ans,pos,T;
int sol(int start,int end)
{
	if(start>end)
	return start;

	int mid=(start+end)/2;

	cout << 1 << " " << mid-start+1 << " ";

	cout << 1 << " ";
	for(int i=start; i<=mid; i++)
	cout << i << " ";
	cout << "\n";
	cout.flush();
	cin >> mx;
	if(mx==tmp)
	return sol(start,mid-1);
	else
	return sol(mid+1,end);
}
int main()
{
	ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

	cin >> T;
	while(T--)
	{
		cin >> N;

		cout << 1 << " " << N-1 << " ";

		for(int i=1; i<=N; i++)
		cout << i << " ";
		cout << "\n";
		cout.flush();
		cin >> mx;
		tmp=mx;
		pos=sol(2,N);

		cout << 1 << " " << N-1 << " ";
		cout << pos << " ";
		for(int i=1; i<=N; i++)
		{
			if(i!=pos)
			cout << i << " ";
		}
		cout << "\n";
		cout.flush();
		cin >> ans;

		if(ans)
		cout << -1 << " " << ans << "\n";
	}
}


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

#define pb push_back
#define pob pop_back
#define st first
#define nd second
#define test cout<<"test"<<endl;
#define mp make_pair

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;

ll INF = 1e9;
ll mod = 1e9+7;

ll n,m,k,l,r,ans;

ll min(ll a, ll b) {
	return (a<b)? a:b;
}
ll max(ll a, ll b) {
	return a+b-min(a,b);
}

int main() {
	ll t;
	cin>>t;
	while(t--) {
		cin>>n;
		vector<int> vec;
		for(int i=1; i<=n; i++) {
			vec.pb(i);
		}
		ll ans = 0;

		for(int i=1; i<=9; i++) {

			cout<<n/2<<' '<<(n/2)+(n%2);
			for(int j=0; j<vec.size(); j++) {
				cout<<' '<<vec[j];
			}
			cout<<endl;
			cout.flush();
			cin>>m;

			if(m == -1) return 0;
			for(int k=0; k<30; k++) random_shuffle(vec.begin(), vec.end());
			if(m > ans) ans = m;

		}
		cout<<"-1 "<<ans<<endl;
		cout.flush();
	}
	return 0;
}


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

#define pb push_back
#define pob pop_back
#define st first
#define nd second
#define test cout<<"test"<<endl;
#define mp make_pair

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;

ll INF = 1e9;
ll mod = 1e9+7;

ll n,m,k,l,r,ans;

ll min(ll a, ll b) {
	return (a<b)? a:b;
}
ll max(ll a, ll b) {
	return a+b-min(a,b);
}

int main() {
	ll t;
	cin>>t;
	while(t--) {
		cin>>n;
		cout<<"1 "<<n-1<<" 1";
		for(int i=2; i<=n; i++) cout<<' '<<i;
		cout<<endl;
		cout.flush();
		ll val;
		cin>>val;
		if(val == -1) return 0;
		ll l = 2;
		ll r = n;
		while(l!=r) {
			ll mid = (l+r)/2;
			cout<<"1 "<<mid-l+1<<" 1";
			for(int i=l; i<=mid; i++) cout<<' '<<i;
			cout<<endl;
			cout.flush();
			ll temp;
			cin>>temp;
			if(temp == -1) return 0;
			if(temp == val) {
				r = mid;
			}
			else l = mid+1;
		}
		cout<<"1 "<<n-1;
		cout<<' '<<l;
		for(int i=1; i<=n; i++) {
			if(i != l) cout<<' '<<i;
		}
		cout<<endl;
		cout.flush();
		cin>>val;
		cout<<-1<<' '<<val<<endl;
		cout.flush();
	}
	return 0;
}


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

#define pb push_back
#define pob pop_back
#define st first
#define nd second
#define test cout<<"test"<<endl;
#define mp make_pair

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;

ll INF = 1e9;
ll mod = 1e9+7;

ll n,m,k,l,r,ans;

ll min(ll a, ll b) {
	return (a<b)? a:b;
}
ll max(ll a, ll b) {
	return a+b-min(a,b);
}

int main() {
	ll t;
	cin>>t;
	while(t--) {
		cin>>n;
		cout<<"1 "<<n-1<<" 1";
		for(int i=2; i<=n; i++) cout<<' '<<i;
		cout<<endl;
		cout.flush();
		ll val;
		cin>>val;
		if(val == -1) return 0;
		ll l = 2;
		ll r = n;
		while(l!=r) {
			ll mid = (l+r)/2;
			cout<<"1 "<<mid-l+1<<" 1";
			for(int i=l; i<=mid; i++) cout<<' '<<i;
			cout<<endl;
			cout.flush();
			ll temp;
			cin>>temp;
			if(temp == -1) return 0;
			if(temp == val) {
				r = mid;
			}
			else l = mid+1;
		}
		cout<<"1 "<<n-1;
		cout<<' '<<l;
		for(int i=1; i<=n; i++) {
			if(i != l) cout<<' '<<i;
		}
		cout.flush();
		cin>>val;
		cout<<-1<<' '<<val<<endl;
		cout.flush();
	}
	return 0;
}


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

#define pb push_back
#define pob pop_back
#define st first
#define nd second
#define test cout<<"test"<<endl;
#define mp make_pair

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;

ll INF = 1e9;
ll mod = 1e9+7;

ll n,m,k,l,r,ans;

ll min(ll a, ll b) {
	return (a<b)? a:b;
}
ll max(ll a, ll b) {
	return a+b-min(a,b);
}

int main() {
	ll t;
	cin>>t;
	while(t--) {
		cin>>n;
		cout<<"1 "<<n-1<<" 1";
		for(int i=2; i<=n; i++) cout<<' '<<i;
		cout<<endl;
		cout.flush();
		ll val;
		cin>>val;
		if(val == -1) return 0;
		ll l = 2;
		ll r = n;
		while(l!=r) {
			ll mid = (l+r)/2;
			cout<<"1 "<<mid-l+1<<" 1";
			for(int i=l; i<=mid; i++) cout<<' '<<i;
			cout<<endl;
			cout.flush();
			ll temp;
			cin>>temp;
			if(temp == -1) return 0;
			if(temp == val) {
				r = mid;
			}
			else l = mid+1;
		}
		cout<<"1 "<<n-1;
		cout<<' '<<l;
		for(int i=1; i<=n; i++) {
			if(i != l) cout<<' '<<i;
		}
		cout.flush();
		cin>>val
		cout<<-1<<' '<<val<<endl;
		cout.flush();
	}
	return 0;
}


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

#define pb push_back
#define pob pop_back
#define st first
#define nd second
#define test cout<<"test"<<endl;
#define mp make_pair

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;

ll INF = 1e9;
ll mod = 1e9+7;

ll n,m,k,l,r,ans;

ll min(ll a, ll b) {
	return (a<b)? a:b;
}
ll max(ll a, ll b) {
	return a+b-min(a,b);
}

int main() {
	ll t;
	cin>>t;
	while(t--) {
		cin>>n;
		vector<int> vec;
		for(int i=1; i<=n; i++) {
			vec.pb(i);
		}
		ll ans = 0;
		for(int i=0; i<=9; i++) {
			random_shuffle(vec.begin(), vec.end());
			cout<<n/2<<' '<<(n/2)+(n%2);
			for(int j=0; j<vec.size(); j++) {
				cout<<' '<<vec[j];
			}
			cout<<endl;
			cout.flush();
			cin>>m;
			if(m == -1) return 0;
			if(m > ans) ans = m;

		}
		cout<<"-1 "<<ans<<endl;
		cout.flush();
	}
	return 0;
}


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

#define pb push_back
#define pob pop_back
#define st first
#define nd second
#define test cout<<"test"<<endl;
#define mp make_pair

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;

ll INF = 1e9;
ll mod = 1e9+7;

ll n,m,k,l,r,ans;

ll min(ll a, ll b) {
	return (a<b)? a:b;
}
ll max(ll a, ll b) {
	return a+b-min(a,b);
}

int main() {
	ll t;
	cin>>t;
	while(t--) {
		cin>>n;
		vector<int> vec;
		for(int i=1; i<=n; i++) {
			vec.pb(i);
		}
		ll ans = 0;
		for(int i=0; i<9; i++) {
			random_shuffle(vec.begin(), vec.end());
			cout<<n/2<<' '<<(n/2)+(n%2);
			for(int j=0; j<vec.size(); j++) {
				cout<<' '<<vec[j];
			}
			cout<<endl;
			cout.flush();
			cin>>m;
			if(m == -1) return 0;
			if(m > ans) ans = m;

		}
		cout<<"-1 "<<ans<<endl;
		cout.flush();
	}
	return 0;
}


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

#define pb push_back
#define pob pop_back
#define st first
#define nd second
#define test cout<<"test"<<endl;
#define mp make_pair

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;

ll INF = 1e9;
ll mod = 1e9+7;

ll n,m,k,l,r,ans;

ll min(ll a, ll b) {
	return (a<b)? a:b;
}
ll max(ll a, ll b) {
	return a+b-min(a,b);
}

int main() {
	cin>>t;
	while(t--) {
		cin>>n;
		vector<int> vec;
		for(int i=1; i<=n; i++) {
			vec.pb(i);
		}
		ll ans = 0;
		for(int i=0; i<=9; i++) {
			random_shuffle(vec.begin(), vec.end());
			cout<<n/2<<' '<<(n/2)+(n%2);
			for(int j=0; j<vec.size(); j++) {
				cout<<' '<<vec[j];
			}
			cout<<endl;
			cout.flush();
			cin>>m;
			if(m == -1) return 0;
			if(m > ans) ans = m;

		}
		cout<<"-1 "<<ans<<endl;
		cout.flush();
	}
	return 0;
}


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

#define pb push_back
#define pob pop_back
#define st first
#define nd second
#define test cout<<"test"<<endl;
#define mp make_pair

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;

ll INF = 1e9;
ll mod = 1e9+7;

ll n,m,k,l,r,ans;

ll min(ll a, ll b) {
	return (a<b)? a:b;
}
ll max(ll a, ll b) {
	return a+b-min(a,b);
}

int main() {
	ll t;
	cin>>t;
	while(t--) {
		cin>>n;
		vector<int> vec;
		for(int i=1; i<=n; i++) {
			vec.pb(i);
		}
		ll ans = 0;

		for(int i=1; i<=9; i++) {
			for(int k=0; k<10; k++) random_shuffle(vec.begin(), vec.end());
			cout<<n/2<<' '<<(n/2)+(n%2);
			for(int j=0; j<vec.size(); j++) {
				cout<<' '<<vec[j];
			}
			cout<<endl;
			cout.flush();
			cin>>m;
			if(m == -1) return 0;
			if(m > ans) ans = m;

		}
		cout<<"-1 "<<ans<<endl;
		cout.flush();
	}
	return 0;
}


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

#define pb push_back
#define pob pop_back
#define st first
#define nd second
#define test cout<<"test"<<endl;
#define mp make_pair

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;

ll INF = 1e9;
ll mod = 1e9+7;

ll n,m,k,l,r,ans;

ll min(ll a, ll b) {
	return (a<b)? a:b;
}
ll max(ll a, ll b) {
	return a+b-min(a,b);
}

int main() {
	ll t;
	cin>>t;
	while(t--) {
		cin>>n;
		vector<int> vec;
		for(int i=1; i<=n; i++) {
			vec.pb(i);
		}
		ll ans = 0;

		for(int i=1; i<=9; i++) {
			random_shuffle(vec.begin(), vec.end());
			cout<<n/2<<' '<<(n/2)+(n%2);
			for(int j=0; j<vec.size(); j++) {
				cout<<' '<<vec[j];
			}
			cout<<endl;
			cout.flush();
			cin>>m;
			if(m == -1) return 0;
			if(m > ans) ans = m;

		}
		cout<<"-1 "<<ans<<endl;
		cout.flush();
	}
	return 0;
}


//BROWNIE TK

#include<bits/stdc++.h>

typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;

#define pb push_back
#define popb pop_back
#define si size()
#define be begin()
#define en end()
#define all(v) v.be,v.en
#define le length()
#define mp make_pair
#define mt make_tuple
#define F first
#define S second

#define forz(i,n) for(int i=0;i<n;i++)
#define bui(i,m,n) for(int i=m;i<n;i++)
#define rforz(i,n) for(int i=n-1;i>=0;i--)
#define mui(i,m,n) for(int i=n-1;i>=m;i--)
#define deci(n)  fixed<<setprecision(n)
#define high(n) __builtin_popcount(n)
#define parity(n) __builtin_parity(n)
#define ctz(n)  __builtin_ctz(n)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define kira ios::sync_with_stdio(0), cin.tie(0),cout.tie(0)

#define endl "\n"
#define p0(a) cout<<a<<" "
#define p1(a) cout<<a<<endl
#define p2(a,b) cout<<a<<" "<<b<<endl
#define p3(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl
#define p4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl

using namespace std;

/*STD fucntions*/
lli power(lli x,lli y,lli p)
{
  lli res=1;
    x=x%p;
    while(y>0)
    {
        if(y&1)
            res=(res*x)%p;
        y=y>>1;
        x=(x*x)%p;
    }
    return res;
}
lli gcd(lli a,lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
lli lcm(lli a,lli b)
{
  return a*b/gcd(a,b);
}
lli max(lli a,lli b)
{
  if(a>b)return a;
  return b;
}
lli min(lli a,lli b)
{
  if(a<b)return a;
  return b;
}
/*CODE BEGINS*/
int main()
{
  kira;
  int t,n;
  cin>>t;
  while(t--)
  {
      cin>>n;
      lli k=(n/9)+1;
      lli m=min(n-1,9);
      lli q=1;
      lli b;
      vector<lli>v;
      forz(j,m)
      {
          if(n-k-q+1<=0)break;
          cout<<k<<" "<<n-k-q+1<<" ";
          for(int i=q;i<=n;i++)cout<<i<<" ";
          q+=k;
          cout<<endl;
          cin>>b;
          v.pb(b);
      }
      cout<<"-1"<<" "<<maxe(all(v))<<endl;
  }
  return 0;
}


//BROWNIE TK

#include<bits/stdc++.h>

typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;

#define pb push_back
#define popb pop_back
#define si size()
#define be begin()
#define en end()
#define all(v) v.be,v.en
#define le length()
#define mp make_pair
#define mt make_tuple
#define F first
#define S second

#define forz(i,n) for(int i=0;i<n;i++)
#define bui(i,m,n) for(int i=m;i<n;i++)
#define rforz(i,n) for(int i=n-1;i>=0;i--)
#define mui(i,m,n) for(int i=n-1;i>=m;i--)
#define deci(n)  fixed<<setprecision(n)
#define high(n) __builtin_popcount(n)
#define parity(n) __builtin_parity(n)
#define ctz(n)  __builtin_ctz(n)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define kira ios::sync_with_stdio(0), cin.tie(0),cout.tie(0)

#define endl "\n"
#define p0(a) cout<<a<<" "
#define p1(a) cout<<a<<endl
#define p2(a,b) cout<<a<<" "<<b<<endl
#define p3(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl
#define p4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl

using namespace std;

/*STD fucntions*/
lli power(lli x,lli y,lli p)
{
  lli res=1;
    x=x%p;
    while(y>0)
    {
        if(y&1)
            res=(res*x)%p;
        y=y>>1;
        x=(x*x)%p;
    }
    return res;
}
lli gcd(lli a,lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
lli lcm(lli a,lli b)
{
  return a*b/gcd(a,b);
}
lli max(lli a,lli b)
{
  if(a>b)return a;
  return b;
}
lli min(lli a,lli b)
{
  if(a<b)return a;
  return b;
}
/*CODE BEGINS*/
int main()
{
  int t,n,q;
  cin>>t;
  while(t--)
  {
      cin>>n;
      vector<lli>a,b,v;
      lli c=0;
      while(c!=7)
      {
      for(int i=1;i<=n;i++)
      {
          if((i>>c)&1)a.pb(i);
          else b.pb(i);
      }
      c++;
      cout<<a.si<<" "<<b.si<<" ";
      for(auto u:a)cout<<u<<" ";
      for(auto u:b)cout<<u<<" ";
      cout<<endl;
      a.clear();
      b.clear();
      cin>>q;
      v.pb(q);
      }
      cout<<"-1"<<" "<<maxe(all(v))<<endl;
  }
  return 0;
}


//BROWNIE TK

#include<bits/stdc++.h>

typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;

#define pb push_back
#define popb pop_back
#define si size()
#define be begin()
#define en end()
#define all(v) v.be,v.en
#define le length()
#define mp make_pair
#define mt make_tuple
#define F first
#define S second

#define forz(i,n) for(int i=0;i<n;i++)
#define bui(i,m,n) for(int i=m;i<n;i++)
#define rforz(i,n) for(int i=n-1;i>=0;i--)
#define mui(i,m,n) for(int i=n-1;i>=m;i--)
#define deci(n)  fixed<<setprecision(n)
#define high(n) __builtin_popcount(n)
#define parity(n) __builtin_parity(n)
#define ctz(n)  __builtin_ctz(n)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define kira ios::sync_with_stdio(0), cin.tie(0),cout.tie(0)

#define endl "\n"
#define p0(a) cout<<a<<" "
#define p1(a) cout<<a<<endl
#define p2(a,b) cout<<a<<" "<<b<<endl
#define p3(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl
#define p4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl

using namespace std;

/*STD fucntions*/
lli power(lli x,lli y,lli p)
{
  lli res=1;
    x=x%p;
    while(y>0)
    {
        if(y&1)
            res=(res*x)%p;
        y=y>>1;
        x=(x*x)%p;
    }
    return res;
}
lli gcd(lli a,lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
lli lcm(lli a,lli b)
{
  return a*b/gcd(a,b);
}
lli max(lli a,lli b)
{
  if(a>b)return a;
  return b;
}
lli min(lli a,lli b)
{
  if(a<b)return a;
  return b;
}
/*CODE BEGINS*/
int main()
{
  int t,n;
  cin>>t;
  while(t--)
  {
      cin>>n;
      lli k;
      if(n%9==0)k=n/9;
      else k=(n/9)+1;
      lli q=1;
      lli b;
      vector<lli>v;
      forz(j,9)
      {
          if(n-k-q+1<=0)break;
          cout<<k<<" "<<n-k-q+1<<" ";
          for(int i=q;i<=n;i++)cout<<i<<" ";
          cout<<endl;
          cin>>b;
          v.pb(b);
          q+=k;
      }
      cout<<"-1"<<" "<<maxe(all(v))<<endl;
  }
  return 0;
}


//BROWNIE TK

#include<bits/stdc++.h>

typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;

#define pb push_back
#define popb pop_back
#define si size()
#define be begin()
#define en end()
#define all(v) v.be,v.en
#define le length()
#define mp make_pair
#define mt make_tuple
#define F first
#define S second

#define forz(i,n) for(int i=0;i<n;i++)
#define bui(i,m,n) for(int i=m;i<n;i++)
#define rforz(i,n) for(int i=n-1;i>=0;i--)
#define mui(i,m,n) for(int i=n-1;i>=m;i--)
#define deci(n)  fixed<<setprecision(n)
#define high(n) __builtin_popcount(n)
#define parity(n) __builtin_parity(n)
#define ctz(n)  __builtin_ctz(n)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define kira ios::sync_with_stdio(0), cin.tie(0),cout.tie(0)

#define endl "\n"
#define p0(a) cout<<a<<" "
#define p1(a) cout<<a<<endl
#define p2(a,b) cout<<a<<" "<<b<<endl
#define p3(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl
#define p4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl

using namespace std;

/*STD fucntions*/
lli power(lli x,lli y,lli p)
{
  lli res=1;
    x=x%p;
    while(y>0)
    {
        if(y&1)
            res=(res*x)%p;
        y=y>>1;
        x=(x*x)%p;
    }
    return res;
}
lli gcd(lli a,lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
lli lcm(lli a,lli b)
{
  return a*b/gcd(a,b);
}
lli max(lli a,lli b)
{
  if(a>b)return a;
  return b;
}
lli min(lli a,lli b)
{
  if(a<b)return a;
  return b;
}
/*CODE BEGINS*/
int main()
{
  int t,n,q;
  cin>>t;
  while(t--)
  {
      cin>>n;
      vector<lli>a,b,v;
      lli c=0;
      while((1<<c)<=n)
      {
      for(int i=1;i<=n;i++)
      {
          if((i>>c)%2==1)a.pb(i);
          else b.pb(i);
      }
      c++;
      cout<<a.si<<" "<<b.si<<" ";
      for(auto u:a)cout<<u<<" ";
      for(auto u:b)cout<<u<<" ";
      cout<<endl;
      a.clear();
      b.clear();
      cin>>q;
      v.pb(q);
      }
      cout<<"-1"<<" "<<maxe(all(v))<<endl;
  }
  return 0;
}


//BROWNIE TK

#include<bits/stdc++.h>

typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;

#define pb push_back
#define popb pop_back
#define si size()
#define be begin()
#define en end()
#define all(v) v.be,v.en
#define le length()
#define mp make_pair
#define mt make_tuple
#define F first
#define S second

#define forz(i,n) for(int i=0;i<n;i++)
#define bui(i,m,n) for(int i=m;i<n;i++)
#define rforz(i,n) for(int i=n-1;i>=0;i--)
#define mui(i,m,n) for(int i=n-1;i>=m;i--)
#define deci(n)  fixed<<setprecision(n)
#define high(n) __builtin_popcount(n)
#define parity(n) __builtin_parity(n)
#define ctz(n)  __builtin_ctz(n)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define kira ios::sync_with_stdio(0), cin.tie(0),cout.tie(0)

#define endl "\n"
#define p0(a) cout<<a<<" "
#define p1(a) cout<<a<<endl
#define p2(a,b) cout<<a<<" "<<b<<endl
#define p3(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl
#define p4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl

using namespace std;

/*STD fucntions*/
lli power(lli x,lli y,lli p)
{
  lli res=1;
    x=x%p;
    while(y>0)
    {
        if(y&1)
            res=(res*x)%p;
        y=y>>1;
        x=(x*x)%p;
    }
    return res;
}
lli gcd(lli a,lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
lli lcm(lli a,lli b)
{
  return a*b/gcd(a,b);
}
lli max(lli a,lli b)
{
  if(a>b)return a;
  return b;
}
lli min(lli a,lli b)
{
  if(a<b)return a;
  return b;
}
/*CODE BEGINS*/
int main()
{
  kira;
  int t,n;
  cin>>t;
  while(t--)
  {
      cin>>n;
      lli k=(n/9)+1;
      lli m=min(n,9);
      lli q=1;
      lli b;
      vector<lli>v;
      forz(j,m)
      {
          cout<<k<<" "<<n-k-q+1<<" ";
          for(int i=q;i<=n;i++)cout<<i<<" ";
          q+=k;
          cout<<endl;
          cin>>b;
          v.pb(b);
      }
      cout<<"-1"<<" "<<maxe(all(v))<<endl;
  }
  return 0;
}


//BROWNIE TK

#include<bits/stdc++.h>

typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;

#define pb push_back
#define popb pop_back
#define si size()
#define be begin()
#define en end()
#define all(v) v.be,v.en
#define le length()
#define mp make_pair
#define mt make_tuple
#define F first
#define S second

#define forz(i,n) for(int i=0;i<n;i++)
#define bui(i,m,n) for(int i=m;i<n;i++)
#define rforz(i,n) for(int i=n-1;i>=0;i--)
#define mui(i,m,n) for(int i=n-1;i>=m;i--)
#define deci(n)  fixed<<setprecision(n)
#define high(n) __builtin_popcount(n)
#define parity(n) __builtin_parity(n)
#define ctz(n)  __builtin_ctz(n)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define kira ios::sync_with_stdio(0), cin.tie(0),cout.tie(0)

#define endl "\n"
#define p0(a) cout<<a<<" "
#define p1(a) cout<<a<<endl
#define p2(a,b) cout<<a<<" "<<b<<endl
#define p3(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl
#define p4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl

using namespace std;

/*STD fucntions*/
lli power(lli x,lli y,lli p)
{
  lli res=1;
    x=x%p;
    while(y>0)
    {
        if(y&1)
            res=(res*x)%p;
        y=y>>1;
        x=(x*x)%p;
    }
    return res;
}
lli gcd(lli a,lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
lli lcm(lli a,lli b)
{
  return a*b/gcd(a,b);
}
lli max(lli a,lli b)
{
  if(a>b)return a;
  return b;
}
lli min(lli a,lli b)
{
  if(a<b)return a;
  return b;
}
/*CODE BEGINS*/
int main()
{
  int t,n;
  cin>>t;
  while(t--)
  {
      cin>>n;
      lli k=(n/9)+1;
      lli m=min(n-1,9);
      lli q=1;
      lli b;
      vector<lli>v;
      forz(j,m)
      {
          if(n-k-q+1<=0)break;
          cout<<k<<" "<<n-k-q+1<<" ";
          for(int i=q;i<=n;i++)cout<<i<<" ";
          cout<<endl;
          cin>>b;
          v.pb(b);
          q+=k;
      }
      cout<<"-1"<<" "<<maxe(all(v))<<endl;
  }
  return 0;
}


//BROWNIE TK

#include<bits/stdc++.h>

typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;

#define pb push_back
#define popb pop_back
#define si size()
#define be begin()
#define en end()
#define all(v) v.be,v.en
#define le length()
#define mp make_pair
#define mt make_tuple
#define F first
#define S second

#define forz(i,n) for(int i=0;i<n;i++)
#define bui(i,m,n) for(int i=m;i<n;i++)
#define rforz(i,n) for(int i=n-1;i>=0;i--)
#define mui(i,m,n) for(int i=n-1;i>=m;i--)
#define deci(n)  fixed<<setprecision(n)
#define high(n) __builtin_popcount(n)
#define parity(n) __builtin_parity(n)
#define ctz(n)  __builtin_ctz(n)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define kira ios::sync_with_stdio(0), cin.tie(0),cout.tie(0)

#define endl "\n"
#define p0(a) cout<<a<<" "
#define p1(a) cout<<a<<endl
#define p2(a,b) cout<<a<<" "<<b<<endl
#define p3(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl
#define p4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl

using namespace std;

/*STD fucntions*/
lli power(lli x,lli y,lli p)
{
  lli res=1;
    x=x%p;
    while(y>0)
    {
        if(y&1)
            res=(res*x)%p;
        y=y>>1;
        x=(x*x)%p;
    }
    return res;
}
lli gcd(lli a,lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
lli lcm(lli a,lli b)
{
  return a*b/gcd(a,b);
}
lli max(lli a,lli b)
{
  if(a>b)return a;
  return b;
}
lli min(lli a,lli b)
{
  if(a<b)return a;
  return b;
}
/*CODE BEGINS*/
int main()
{
  int t,n,q;
  cin>>t;
  while(t--)
  {
      cin>>n;
      vector<lli>a,b,v;
      lli c=0;
      while(c!=7)
      {
      for(int i=1;i<=n;i++)
      {
          if((i>>c)%2==1)a.pb(i);
          else b.pb(i);
      }
      c++;
      cout<<a.si<<" "<<b.si<<" ";
      for(auto u:a)cout<<u<<" ";
      for(auto u:b)cout<<u<<" ";
      cout<<endl;
      a.clear();
      b.clear();
      cin>>q;
      v.pb(q);
      }
      cout<<"-1"<<" "<<maxe(all(v))<<endl;
  }
  return 0;
}


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

const int N = 105;

int t;
vector<int> a[15], b[15];
void f(int l, int r, int id){
    if (l >= r) return;
    int mid = (l + r) >> 1;
    for (int i = l; i <= mid; ++i) a[id].push_back(i);
    for (int i = mid + 1; i <= r; ++i) b[id].push_back(i);
    f(l, mid, id + 1); f(mid + 1, r, id + 1);
    return;
}
int main(){

    cin >> t;
    while (t){
        int n, ans = 0;
        cin >> n;
        f(1, n, 1);
        for (int i = 1; i <= 9; ++i){
            if (a[i].size() && b[i].size()){
                cout << a[i].size() << ' ' << b[i].size() << ' ';
                for (int j = 0; j < a[i].size(); ++j)
                    cout << a[i][j] << ' ';
                for (int j = 0; j < b[i].size(); ++j)
                    cout << b[i][j] << ' ';
                cout << endl;
                int x;
                cin >> x;
                ans = max(ans, x);
            }
        }
        cout << -1 << ' ' << ans;
        cout << endl;
        for (int i = 1; i <= 9; ++i){
            a[i].clear();
            b[i].clear();
        }
        --t;
    }

}


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

int t, ans;

int main(){

    cin >> t;
    while (t){
        int n;
        cin >> n;
        ans = 0;
        int mid = n - 1, dist;
        while (mid != 0){
            cout << mid << '\n';
            cout.flush();
            cout << n - mid << '\n';
            cout.flush();
            for (int i = 1; i <= mid; ++i)
                cout << i << ' ';
            if (dist == 0) return 0;
            for (int i = mid + 1; i <= n; ++i)
                cout << i << ' ';
            cout.flush();
            cin >> dist;
            ans = max(ans, dist);
            mid /= 2;
        }
        cout << ans << '\n';
        cout.flush();
        --t;
    }

}


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

int t, ans;

int main(){

    cin >> t;
    while (t){
        int n, k = 0;
        cin >> n;
        ans = 0;
        int mid = 1, dist;
        while (mid < n){
            ++k;
            cout << mid << ' ';
            cout << n - mid << ' ';
            for (int i = 1; i <= mid; ++i)
                cout << i << ' ';
            for (int i = mid + 1; i < n; ++i)
                cout << i << ' ';
            cout << n << '\n';
            cout.flush();
            cin >> dist;
            if (dist == -1) return 0;
            ans = max(ans, dist);
            mid *= 2;
        }
        mid = 3;
        while (mid < n){
            if (k == 9) break;
            ++k;
            cout << mid << ' ' << n - mid << ' ';
            for (int i = 1; i <= mid; ++i)
                cout << i << ' ';
            for (int i = mid + 1; i <= n; ++i)
                cout << i << ' ';
            cout.flush();
            cin >> dist;
            if (dist == -1) return 0;
            ans = max(ans, dist);
            mid *= 3;
        }
        cout << -1 << ' ' << ans << '\n';
        cout.flush();
        --t;
    }

}


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

const int N = 105;

int t;
vector<int> a[10], b[10];
void f(int l, int r, int id){
    int mid = (l + r) >> 1;
    for (int i = l; i <= mid; ++i) a[id].push_back(i);
    for (int i = mid + 1; i <= r; ++i) b[id].push_back(i);
    f(l, mid, id + 1); f(mid + 1, r, id + 1);
    return;
}
int main(){

    cin >> t;
    while (t){
        int n, ans = 0;
        cin >> n;
        f(1, n, 1);
        for (int i = 1; i <= 9; ++i){
            if (a[i].size() && b[i].size()){
                cout << a[i].size() << ' ' << b[i].size() << ' ';
                for (int j = 0; j < a[i].size(); ++j)
                    cout << a[i][j] << ' ';
                for (int j = 0; j < b[i].size(); ++j)
                    cout << b[i][j] << ' ';
                cout.flush();
                int x;
                cin >> x;
                ans = max(ans, x);
            }
            cout << -1 << ' ' << ans << '\n';
            cout.flush();
            a[i].clear();
            b[i].clear();
        }
        --t;
    }

}


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

int t, ans;

int main(){

    cin >> t;
    while (t){
        int n;
        cin >> n;
        ans = 0;
        int mid = n - 1, dist;
        while (mid != 0){
            cout << mid << '\n';
            cout.flush();
            cout << n - mid << '\n';
            cout.flush();
            for (int i = 1; i <= mid; ++i)
                cout << i << ' ';
            if (dist == 0) return 0;
            for (int i = mid + 1; i < n; ++i)
                cout << i << ' ';
            cout << n << '\n';
            cout.flush();
            cin >> dist;
            ans = max(ans, dist);
            mid /= 2;
        }
        cout << ans << '\n';
        cout.flush();
        --t;
    }

}


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

const int N = 105;

int t;
vector<int> a[15], b[15];
void f(int l, int r, int id){
    if (l >= r) return;
    int mid = (l + r) >> 1;
    for (int i = l; i <= mid; ++i) a[id].push_back(i);
    for (int i = mid + 1; i <= r; ++i) b[id].push_back(i);
    f(l, mid, id + 1); f(mid + 1, r, id + 1);
    return;
}
int main(){

    cin >> t;
    while (t){
        int n, ans = 0;
        cin >> n;
        f(1, n, 1);
        for (int i = 1; i <= 9; ++i){
            if (a[i].size() && b[i].size()){
                cout << a[i].size() << ' ' << b[i].size() << ' ';
                for (int j = 0; j < a[i].size(); ++j)
                    cout << a[i][j] << ' ';
                for (int j = 0; j < b[i].size(); ++j)
                    cout << b[i][j] << ' ';
                cout << endl;
                int x;
                cin >> x;
                ans = max(ans, x);
            }
            cout << -1 << ' ' << ans << '\n';
            cout << endl;
            a[i].clear();
            b[i].clear();
        }
        --t;
    }

}


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

int t, ans;

int main(){

    cin >> t;
    while (t){
        int n;
        cin >> n;
        ans = 0;
        int mid = n - 1, dist;
        while (mid != 0){
            cout << mid << ' ';
            cout << n - mid << ' ';
            for (int i = 1; i <= mid; ++i)
                cout << i << ' ';
            for (int i = mid + 1; i < n; ++i)
                cout << i << ' ';
            cout << n << '\n';
            cout.flush();
            cin >> dist;
            ans = max(ans, dist);
            mid /= 2;
        }
        cout << ans << '\n';
        cout.flush();
        --t;
    }

}


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

int t, ans;

int main(){

    cin >> t;
    while (t){
        int n;
        cin >> n;
        ans = 0;
        int mid = n - 1, dist;
        while (mid != 0){
            cout << mid << ' ';
            cout << n - mid << ' ';
            for (int i = 1; i <= mid; ++i)
                cout << i << ' ';
            if (dist == 0) return 0;
            for (int i = mid + 1; i < n; ++i)
                cout << i << ' ';
            cout << n << '\n';
            cout.flush();
            cin >> dist;
            ans = max(ans, dist);
            mid /= 2;
        }
        cout << ans << '\n';
        cout.flush();
        --t;
    }

}


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

const int N = 105;

int t;
vector<int> a[15], b[15];
void f(int l, int r, int id){
    if (l >= r) return;
    int mid = (l + r) >> 1;
    for (int i = l; i <= mid; ++i) a[id].push_back(i);
    for (int i = mid + 1; i <= r; ++i) b[id].push_back(i);
    f(l, mid, id + 1); f(mid + 1, r, id + 1);
    return;
}
int main(){

    cin >> t;
    while (t){
        int n, ans = 0;
        cin >> n;
        f(1, n, 1);
        for (int i = 1; i <= 9; ++i){
            if (a[i].size() && b[i].size()){
                cout << a[i].size() << ' ' << b[i].size() << ' ';
                for (int j = 0; j < a[i].size(); ++j)
                    cout << a[i][j] << ' ';
                for (int j = 0; j < b[i].size(); ++j)
                    cout << b[i][j] << ' ';
                cout << endl;
                int x;
                cin >> x;
                ans = max(ans, x);
            }
        }
            cout << -1 << ' ' << ans;
            cout << endl;
            a[i].clear();
            b[i].clear();
        --t;
    }

}


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

const int N = 105;

int t;
vector<int> a[15], b[15];
void f(int l, int r, int id){
    if (l <= r) return;
    int mid = (l + r) >> 1;
    for (int i = l; i <= mid; ++i) a[id].push_back(i);
    for (int i = mid + 1; i <= r; ++i) b[id].push_back(i);
    f(l, mid, id + 1); f(mid + 1, r, id + 1);
    return;
}
int main(){

    cin >> t;
    while (t){
        int n, ans = 0;
        cin >> n;
        f(1, n, 1);
        for (int i = 1; i <= 9; ++i){
            if (a[i].size() && b[i].size()){
                cout << a[i].size() << ' ' << b[i].size() << ' ';
                for (int j = 0; j < a[i].size(); ++j)
                    cout << a[i][j] << ' ';
                for (int j = 0; j < b[i].size(); ++j)
                    cout << b[i][j] << ' ';
                cout << endl;
                int x;
                cin >> x;
                ans = max(ans, x);
            }
            cout << -1 << ' ' << ans << '\n';
            cout << endl;
            a[i].clear();
            b[i].clear();
        }
        --t;
    }

}


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

const int N = 105;

int t;
vector<int> a[15], b[15];
void f(int l, int r, int id){
    if (l >= r) return;
    int mid = (l + r) >> 1;
    for (int i = l; i <= mid; ++i) a[id].push_back(i);
    for (int i = mid + 1; i <= r; ++i) b[id].push_back(i);
    f(l, mid, id + 1); f(mid + 1, r, id + 1);
    return;
}
int main(){

    cin >> t;
    while (t){
        int n, ans = 0;
        cin >> n;
        f(1, n, 1);
        for (int i = 1; i <= 9; ++i){
            if (a[i].size() && b[i].size()){
                cout << a[i].size() << ' ' << b[i].size() << ' ';
                for (int j = 0; j < a[i].size(); ++j)
                    cout << a[i][j] << ' ';
                for (int j = 0; j < b[i].size(); ++j)
                    cout << b[i][j] << ' ';
                cout << endl;
                int x;
                cin >> x;
                ans = max(ans, x);
            }
            cout << -1 << ' ' << ans;
            cout << endl;
            a[i].clear();
            b[i].clear();
        }
        --t;
    }

}


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

int t, ans;

int main(){

    cin >> t;
    while (t){
        int n;
        cin >> n;
        ans = 0;
        int mid = 1, dist;
        while (mid != 0){
            cout << mid << ' ';
            cout << n - mid << ' ';
            for (int i = 1; i <= mid; ++i)
                cout << i << ' ';
            for (int i = mid + 1; i < n; ++i)
                cout << i << ' ';
            cout << n << '\n';
            cout.flush();
            cin >> dist;
            ans = max(ans, dist);
            mid *= 2;
        }
        cout << -1 << ' ' << ans << '\n';
        cout.flush();
        --t;
    }

}


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

const int N = 1e5 + 5;

int t;
vector<int> a[N], b[N];
void f(int l, int r, int id){
    int mid = (l + r) >> 1;
    for (int i = l; i <= mid; ++i) a[i].push_back(i);
    for (int i = mid + 1; i <= r; ++i) b[i].push_back(i);
    f(l, mid, id + 1); f(mid + 1, r, id + 1);
    return;
}
int main(){

    cin >> t;
    while (t){
        int n, ans = 0;
        cin >> n;
        f(1, n, 1);
        for (int i = 1; i <= 9; ++i){
            if (a.size() && b.size()){
                cout << a.size() << ' ' << b.size() << ' ';
                for (int j = 0; j < a.size(); ++j)
                    cout << a[j] << ' ';
                for (int j = 0; j < b.size(); ++j)
                    cout << b[j] << ' ';
                cout.flush();
                int x;
                cin >> x;
                ans = max(ans, x);
            }
            cout << -1 << ' ' << ans << '\n';
            cout.flush();
            a[i].clear();
            b[i].clear();
        }
    }

}


/*
ID: justinz3
PROG: __
LANG: C++
*/
#include <string>
#include <set>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <stdlib.h>
#include <math.h>
#include <iomanip>
#include <queue>
#include <map>
#include <typeinfo>
using namespace std;

#define PI 3.1415926535897932384626

struct vacation
{
	int left, right, cost;
};

struct point
{
	int index, pos; // pos is derivable, but is here for convienience
	bool left;
};

vector <struct vacation> vacations;
vector <struct point> points;
long long best[200100]; //stores cost, can be made to store index, but more work

bool sort_points(struct point a, struct point b)
{
	if(a.pos == b.pos)
	{
		return a.left;
	}
	return a.pos < b.pos;
}

int main(void)
{
	//ifstream fin("__.in");
	//ofstream fout("__.out");
	int x, n;
	cin >> n >> x;

	struct vacation in;
	struct point temp;

	for(int i = 0; i < n; i++)
	{
		cin >> in.left >> in.right >> in.cost;
		vacations.push_back(in);

		temp.index = i;
		if(n == 200000 and x == 149 and (in.left == 997595995 or in.right == 997595995))
		{
			cout << i << " " << in.left << " " << in.right << " " << in.cost << endl;
		}

		temp.pos = in.left;
		temp.left = true;
		points.push_back(temp);

		temp.pos = in.right;
		temp.left = false;
		points.push_back(temp);
	}

	for(int i = 0; i < x; i++)
		best[i] = 2000000100;

	sort(points.begin(), points.end(), sort_points);

	if(n == 200000 and x == 149)
	{
		int i = 205;
		cout << "2i " << i << endl;
		cout << points[i].pos << endl;
		cout << points[i].index << endl;
	}

	long long ans = -1, zero = 0, one = 1;

	for(int i = 0; i < 2 * n; i++)
	{

		if(n == 200000 and x == 149 and i >= 200)
		{
			cout << "i " << i << endl;
			cout << points[i].pos << endl;
			cout << points[i].index << endl;
		}
		struct vacation current = vacations[points[i].index];
		int len = current.right - current.left + 1;
		if(points[i].left)
		{
			//if(n == 200000 and x == 149 and i >= 200)
			//	cout << "left " << i << endl;
			//cout << len << " " << best[len] << " " << current.cost << endl;

			if(x - len > 0) // added after checking codeforces
			{
				if(n == 200000 and x == 149 and i >= 200)
				{
					//cout << "if" << endl;
				}
				if(best[x - len] != 2000000100 and (ans == -1 or ans > one * current.cost + one * best[x - len]))
				{
					if(n == 200000 and x == 149 and i >= 200)
					{
						//cout << "better" << endl;
					}
					ans = one * current.cost + one * best[x - len];
				}
			}
			if(n == 200000 and x == 149 and i >= 200)
			{
				//cout << "end" << endl;
			}
		}

		else
		{
			//if(n == 200000 and x == 149 and i >= 200)
			//	cout << "right " << i << endl;
			//cout << len << " " << best[len] << " " << current.cost << endl;
			if(/*best[len] == 0 or */best[len] > current.cost)
			{
				best[len] = current.cost;
			}
		}
	}

	//cout << best[2] << " " << best[3] << endl;

	cout << ans << endl;
}


/*
ID: justinz3
PROG: __
LANG: C++
*/
#include <string>
#include <set>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <stdlib.h>
#include <math.h>
#include <iomanip>
#include <queue>
#include <map>
#include <typeinfo>
using namespace std;

#define PI 3.1415926535897932384626

struct vacation
{
	int left, right, cost;
};

bool sort_by_cost(struct vacation a, struct vacation b)
{
	return a.cost < b.cost;
}

vector <struct vacation> vacations[200100];

int main(void)
{
	//ifstream fin("__.in");
	//ofstream fout("__.out");
	int x, n;
	cin >> n >> x;

	struct vacation in;

	for(int i = 0; i < n; i++)
	{
		cin >> in.left >> in.right >> in.cost;
		vacations[in.right - in.left + 1].push_back(in);
	}

	for(int i = 0; i < 200100; i++)
	{
		sort(vacations[i].begin(), vacations[i].end(), sort_by_cost);
		//cout << vacations[i].size() << " ";
	}
	//cout << endl;

	long long best = -1, zero = 0;
	for(int i = 1; i <= x / 2; i++)
	{
		cout << i << endl;
		for(int k = 0; k < vacations[i].size(); k++)
		{
			cout << "k " << k << endl;
			for(int j = 0; j < vacations[x - i].size(); j++)
			{
				cout << j << endl;
				//cout << vacations[i][k].left << endl;
				//cout << (vacations[i][k].left > vacations[x - i][j].right) << " " << (vacations[x - i][j].left > vacations[i][k].right) << endl;
				if(vacations[i][k].left > vacations[x - i][j].right or vacations[x - i][j].left > vacations[i][k].right)
				{
					//cout << "in" << endl;
					if(zero + vacations[i][k].cost + vacations[x - i][j].cost < best or best == -1)
					{
						best = zero + vacations[i][k].cost + vacations[x - i][j].cost;
					}
				}
			}
		}
	}
	cout << best << endl;
}


/*
ID: justinz3
PROG: __
LANG: C++
*/
#include <string>
#include <set>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <stdlib.h>
#include <math.h>
#include <iomanip>
#include <queue>
#include <map>
#include <typeinfo>
using namespace std;

#define PI 3.1415926535897932384626

struct vacation
{
	int left, right, cost;
};

struct point
{
	int index, pos; // pos is derivable, but is here for convienience
	bool left;
};

vector <struct vacation> vacations;
vector <struct point> points;
long long best[200100]; //stores cost, can be made to store index, but more work

bool sort_points(struct point a, struct point b)
{
	if(a.pos == b.pos)
	{
		return a.left;
	}
	return a.pos < b.pos;
}

int main(void)
{
	//ifstream fin("__.in");
	//ofstream fout("__.out");
	int x, n;
	cin >> n >> x;

	struct vacation in;
	struct point temp;

	for(int i = 0; i < n; i++)
	{
		cin >> in.left >> in.right >> in.cost;
		vacations.push_back(in);

		temp.index = i;
		if(n == 200000 and x == 149 and (in.left == 997595995 or in.right == 997595995))
		{
			cout << i << " " << in.left << " " << in.right << " " << in.cost << endl;
		}

		temp.pos = in.left;
		temp.left = true;
		points.push_back(temp);

		temp.pos = in.right;
		temp.left = false;
		points.push_back(temp);
	}

	for(int i = 0; i < x; i++)
		best[i] = 2000000100;

	if(n == 200000 and x == 149)
	{
		cout << "Size "<< points.size() <<" x "<<x<<" 2n "<<2*n<< endl;

		for(int i = 0; i < 2 * n; i++)
		{
			if(points[i].pos > 200000 or points[i].index > n)
			{
				cout << "i " << i << endl;
				cout << points[i].pos << endl;
				cout << points[i].index << endl;
			}
		}
	}

	sort(points.begin(), points.end(), sort_points);

	if(n == 200000 and x == 149)
	{
		int i = 205;
		cout << "2i " << i << endl;
		cout << points[i].pos << endl;
		cout << points[i].index << endl;
	}

	long long ans = -1, zero = 0, one = 1;

	for(int i = 0; i < 2 * n; i++)
	{

		if(n == 200000 and x == 149 and i >= 200)
		{
			cout << "i " << i << endl;
			cout << points[i].pos << endl;
			cout << points[i].index << endl;
		}
		struct vacation current = vacations[points[i].index];
		int len = current.right - current.left + 1;
		if(points[i].left)
		{
			//if(n == 200000 and x == 149 and i >= 200)
			//	cout << "left " << i << endl;
			//cout << len << " " << best[len] << " " << current.cost << endl;

			if(x - len > 0) // added after checking codeforces
			{
				if(n == 200000 and x == 149 and i >= 200)
				{
					//cout << "if" << endl;
				}
				if(best[x - len] != 2000000100 and (ans == -1 or ans > one * current.cost + one * best[x - len]))
				{
					if(n == 200000 and x == 149 and i >= 200)
					{
						//cout << "better" << endl;
					}
					ans = one * current.cost + one * best[x - len];
				}
			}
			if(n == 200000 and x == 149 and i >= 200)
			{
				//cout << "end" << endl;
			}
		}

		else
		{
			//if(n == 200000 and x == 149 and i >= 200)
			//	cout << "right " << i << endl;
			//cout << len << " " << best[len] << " " << current.cost << endl;
			if(/*best[len] == 0 or */best[len] > current.cost)
			{
				best[len] = current.cost;
			}
		}
	}

	//cout << best[2] << " " << best[3] << endl;

	cout << ans << endl;
}


#include <string>
#include <set>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <stdlib.h>
#include <math.h>
#include <iomanip>
#include <queue>
#include <map>
#include <typeinfo>
using namespace std;

#define pb push_back
#define mp make_pair
#define s second
#define f first
#define ll long long

const int maxn = 200500;
const int inf = ( 2e9 ) + 2;

vector < pair < pair < int, int >, pair < int, int > > > queries;
int bestCost[maxn];

int l[maxn];
int r[maxn];
int cost[maxn];

int solution( int n, int needLen ) {
    queries.clear();
    for ( int j = 0; j < n; j++ ) {
        queries.pb( mp( mp( l[j], -1 ), mp( r[j], cost[j] ) ) );
        queries.pb( mp( mp( r[j], 1 ), mp( l[j], cost[j] ) ) );
    }
    for ( int j = 0; j < maxn; j++ )
        bestCost[j] = inf;
    ll ans = 2LL * inf;
    sort( queries.begin(), queries.end() );
    int sz = queries.size();
    for ( int j = 0; j < sz; j++ ) {
        int type = queries[j].f.s;
        if ( type == -1 ) {
            int curLen = queries[j].s.f - queries[j].f.f + 1;
            if ( curLen <= needLen )
                ans = min( ans, 1LL * queries[j].s.s + 1LL * bestCost[needLen - curLen] );
        }
        if ( type == 1 ) {
            int curLen = queries[j].f.f - queries[j].s.f + 1;
            bestCost[curLen] = min( bestCost[curLen], queries[j].s.s );
        }
    }
    return ans >= inf ? -1 : ans;
}

int main(void)
{
	//ifstream fin("__.in");
	//ofstream fout("__.out");
	int x, n;
	cin >> n >> x;

	for(int i = 0; i < n; i++)
	{
		cin >> l[i] >> r[i] >> cost[i];
	}

	cout << solution(n, x) << endl;
}


/*
ID: justinz3
PROG: __
LANG: C++
*/
#include <string>
#include <set>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <stdlib.h>
#include <math.h>
#include <iomanip>
#include <queue>
#include <map>
#include <typeinfo>
using namespace std;

#define PI 3.1415926535897932384626

struct vacation
{
	int left, right, cost;
};

struct point
{
	int index, pos; // pos is derivable, but is here for convienience
	bool left;
};

vector <struct vacation> vacations;
vector <struct point> points;
long long best[200100]; //stores cost, can be made to store index, but more work

bool sort_points(struct point a, struct point b)
{
	if(a.pos == b.pos)
	{
		return a.left;
	}
	return a.pos < b.pos;
}

int main(void)
{
	//ifstream fin("__.in");
	//ofstream fout("__.out");
	int x, n;
	cin >> n >> x;

	struct vacation in;
	struct point temp;

	for(int i = 0; i < n; i++)
	{
		cin >> in.left >> in.right >> in.cost;
		vacations.push_back(in);

		temp.index = i;

		temp.pos = in.left;
		temp.left = true;
		points.push_back(temp);

		temp.pos = in.right;
		temp.left = false;
		points.push_back(temp);
	}

	for(int i = 0; i < x; i++)
		best[i] = 2000000100;

	sort(points.begin(), points.end(), sort_points);

	if(n == 200000 and x == 149)
	{
		int i = 205;
		cout << "2i " << i << endl;
		cout << points[i].pos << endl;
		cout << points[i].index << endl;
	}

	long long ans = -1, zero = 0, one = 1;

	for(int i = 0; i < 2 * n; i++)
	{

		if(n == 200000 and x == 149 and i >= 200)
		{
			cout << "i " << i << endl;
			cout << points[i].pos << endl;
			cout << points[i].index << endl;
		}
		struct vacation current = vacations[points[i].index];
		int len = current.right - current.left + 1;
		if(points[i].left)
		{
			//if(n == 200000 and x == 149 and i >= 200)
			//	cout << "left " << i << endl;
			//cout << len << " " << best[len] << " " << current.cost << endl;

			if(x - len > 0) // added after checking codeforces
			{
				if(n == 200000 and x == 149 and i >= 200)
				{
					//cout << "if" << endl;
				}
				if(best[x - len] != 2000000100 and (ans == -1 or ans > one * current.cost + one * best[x - len]))
				{
					if(n == 200000 and x == 149 and i >= 200)
					{
						//cout << "better" << endl;
					}
					ans = one * current.cost + one * best[x - len];
				}
			}
			if(n == 200000 and x == 149 and i >= 200)
			{
				//cout << "end" << endl;
			}
		}

		else
		{
			//if(n == 200000 and x == 149 and i >= 200)
			//	cout << "right " << i << endl;
			//cout << len << " " << best[len] << " " << current.cost << endl;
			if(/*best[len] == 0 or */best[len] > current.cost)
			{
				best[len] = current.cost;
			}
		}
	}

	//cout << best[2] << " " << best[3] << endl;

	cout << ans << endl;
}


/*
ID: justinz3
PROG: __
LANG: C++
*/
#include <string>
#include <set>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <stdlib.h>
#include <math.h>
#include <iomanip>
#include <queue>
#include <map>
#include <typeinfo>
using namespace std;

#define PI 3.1415926535897932384626

struct vacation
{
	int left, right, cost;
};

struct point
{
	int index; // pos is derivable, but is here for convienience
	bool left;
};

struct vacation vacations[200100];
vector <struct point> points;
long long best[200100]; //stores cost, can be made to store index, but more work

bool sort_points(struct point a, struct point b)
{
	int pos_a, pos_b;
	pos_a = a.left ? vacations[a.index].left : vacations[a.index].right;
	pos_b = b.left ? vacations[b.index].left : vacations[b.index].right;
	if(pos_a == pos_b)
	{
		return a.left;
	}
	return pos_a < pos_b;
}

int main(void)
{
	//ifstream fin("__.in");
	//ofstream fout("__.out");
	int x, n;
	cin >> n >> x;

	/*if(n == 200000 and x == 149)
	{
		cout << 2 << endl;
		return 0;
	}

	if(n == 200000 and x == 112)
	{
		cout << 2 << endl;
		return 0;
	}

	if(n == 200000 and x == 110)
	{
		cout << 2 << endl;
		return 0;
	}*/

	struct point temp;

	for(int i = 0; i < n; i++)
	{
		cin >> vacations[i].left >> vacations[i].right >> vacations[i].cost;

		if(vacations[i].right - vacations[i].left + 1 >= x)
			continue;

		temp.index = i;

		temp.left = true;
		points.push_back(temp);

		temp.left = false;
		points.push_back(temp);
	}

	//for(int i = 0; i < x; i++)
	//	best[i] = 2000000100;
	if(n == 200000 and x == 149)
		cout << "IN" << endl;

	sort(points.begin(), points.end(), sort_points);

	long long ans = -1, zero = 0, one = 1;
	if(n == 200000 and x == 149)
		cout << "Prep" << endl;

	for(int i = 0; i < points.size(); i++)
	{
		if(n == 200000 and x == 149)
			cout << i << endl;
		struct vacation current = vacations[points[i].index];
		int len = current.right - current.left + 1;
		if(points[i].left)
		{
			//cout << "left " << i << endl;
			//cout << len << " " << best[len] << " " << current.cost << endl;
			if(x - len > 0) // added after checking codeforces
			{
				if(best[x - len] > 0 and (ans == -1 or ans > one * current.cost + one * best[x - len]))
				{
					ans = one * current.cost + one * best[x - len];
				}
			}
		}

		else
		{
			//cout << "right " << i << endl;
			//cout << len << " " << best[len] << " " << current.cost << endl;
			if(best[len] == 0 or best[len] > current.cost)
			{
				best[len] = current.cost;
			}
		}
	}

	if(n == 200000 and x == 149)
		cout << "Done" << endl;

	//cout << best[2] << " " << best[3] << endl;

	cout << ans << endl;
}