#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		Max=0;
		dfs(root,0);
		int L=0,R=n/2;
		int idx=root,idx2;
		bool ok=false;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len==val&&val==dis[node]) {
					ok=true;
					idx=root,idx2=node;
					break;
				}
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		if (!ok) {
			dfs1(idx,0,0,val);
			printf("? %d ",g.size());
			for (int i=0; i<g.size(); i++) {
				printf("%d ",g[i]);
			}
			printf("\n");
			fflush(stdout);
			scanf("%d%d",&idx2,&val);
		}
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dis[root]=0;
		Max=0;
		dfs(root,0);
		int L=1,R=Max;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		int idx2;
		if (g.size()>=2) {
			dfs1(idx,0,0,val);
			printf("? %d ",g.size());
			for (int i=0; i<g.size(); i++) {
				printf("%d ",g[i]);
			}
			printf("\n");
			fflush(stdout);
			scanf("%d%d",&idx2,&val);
		} else idx2=g[1];
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int dep[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	dep[u]=dep[fa]+1;
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs(v,u);
	}
}
vector<int> g;
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
void solve(int u, int m) {
	if (dep[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (dep[v]<dep[u]) continue;
		solve(v,m);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=0; i<maxn; i++) G[i].clear();
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dep[0]=-1;
		dfs(root,0);
		int L=0,R=n/2;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		dfs1(idx,0,0,val);
		printf("? %d ",g.size());
		for (int i=0; i<g.size(); i++) {
			printf("%d ",g[i]);
		}
		printf("\n");
		fflush(stdout);
		int idx2;
		scanf("%d%d",&idx2,&val);
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int dep[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dep[v]=dep[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=0; i<maxn; i++) G[i].clear();
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dep[root]=0;
		dfs(root,0);
		int L=0,R=val/2+10;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			for (int i=1; i<=n; i++) if (dep[i]==m) g.push_back(i);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		dfs1(idx,0,0,val);
		printf("? %d ",g.size());
		for (int i=0; i<g.size(); i++) {
			printf("%d ",g[i]);
		}
		printf("\n");
		fflush(stdout);
		int idx2;
		scanf("%d%d",&idx2,&val);
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		Max=0;
		dfs(root,0);
		int L=0,R=Max;
		int idx=root,idx2;
		bool ok=false;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (val==dis[node]) {
					ok=true;
					idx=root,idx2=node;
					break;
				}
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		if (!ok) {
			dfs1(idx,0,0,val);
			printf("? %d ",g.size());
			for (int i=0; i<g.size(); i++) {
				printf("%d ",g[i]);
			}
			printf("\n");
			fflush(stdout);
			scanf("%d%d",&idx2,&val);
		}
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dis[root]=0;
		Max=0;
		dfs(root,0);
		//ok
		int L=0,R=Max/2+1;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		dfs1(idx,0,0,val);
		printf("? %d ",g.size());
		for (int i=0; i<g.size(); i++) {
			printf("%d ",g[i]);
		}
		printf("\n");
		fflush(stdout);
		int idx2;
		scanf("%d%d",&idx2,&val);
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		Max=0;
		dfs(root,0);
		int L=0,R=(Max+1)/2+1;
		int idx=root,idx2;
		bool ok=false;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len==val&&val==dis[node]) {
					ok=true;
					idx=root,idx2=node;
					break;
				}
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		if (!ok) {
			dfs1(idx,0,0,val);
			printf("? %d ",g.size());
			for (int i=0; i<g.size(); i++) {
				printf("%d ",g[i]);
			}
			printf("\n");
			fflush(stdout);
			scanf("%d%d",&idx2,&val);
		}
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int dep[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	dep[u]=dep[fa]+1;
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs(v,u);
	}
}
vector<int> g;
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
void solve(int u, int m) {
	if (dep[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (dep[v]<dep[u]) continue;
		solve(v,m);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=0; i<maxn; i++) G[i].clear();
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dep[0]=-1;
		dfs(root,0);
		int L=(val+1)/2,R=val;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		dfs1(idx,0,0,val);
		printf("? %d ",g.size());
		for (int i=0; i<g.size(); i++) {
			printf("%d ",g[i]);
		}
		printf("\n");
		fflush(stdout);
		int idx2;
		scanf("%d%d",&idx2,&val);
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dep[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	Max=max(Max,dep[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dep[v]=dep[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=0; i<maxn; i++) G[i].clear();
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dep[root]=0;
		Max=0;
		dfs(root,0);
		int L=0,R=val/2+1;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			for (int i=1; i<=n; i++) if (dep[i]==m) g.push_back(i);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		dfs1(idx,0,0,val);
		printf("? %d ",g.size());
		for (int i=0; i<g.size(); i++) {
			printf("%d ",g[i]);
		}
		printf("\n");
		fflush(stdout);
		int idx2;
		scanf("%d%d",&idx2,&val);
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int dep[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dep[v]=dep[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=0; i<maxn; i++) G[i].clear();
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dep[root]=0;
		dfs(root,0);
		int L=(val+1)/2,R=val;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			for (int i=1; i<=n; i++) if (dep[i]==m) g.push_back(i);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		dfs1(idx,0,0,val);
		printf("? %d ",g.size());
		for (int i=0; i<g.size(); i++) {
			printf("%d ",g[i]);
		}
		printf("\n");
		fflush(stdout);
		int idx2;
		scanf("%d%d",&idx2,&val);
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int dep[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dep[v]=dep[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=0; i<maxn; i++) G[i].clear();
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dep[root]=0;
		dfs(root,0);
		int L=0,R=val/2;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			for (int i=1; i<=n; i++) if (dep[i]==m) g.push_back(i);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		dfs1(idx,0,0,val);
		printf("? %d ",g.size());
		for (int i=0; i<g.size(); i++) {
			printf("%d ",g[i]);
		}
		printf("\n");
		fflush(stdout);
		int idx2;
		scanf("%d%d",&idx2,&val);
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


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

const int N = 1001;

vector< int > adj[N], depth(N), max_depth(N);

int n, root, dist;

void dfs(int i, int par){
	max_depth[i] = depth[i];
	for(int j : adj[i]){
		if(j == par)
			continue;
		depth[j] = 1 + depth[i], dfs(j, i);
		max_depth[i] = max(max_depth[i], max_depth[j]);
	}
}

void find_nodes(int i, int par, int req_depth, vector< int > &nodes){
	if(depth[i] == req_depth){
		nodes.push_back(i);
		return;
	}
	for(int j : adj[i])
		if(j != par)
			find_nodes(j, i, req_depth, nodes);
}

pair query(vector< int > nodes){
	cout << "? " << nodes.size() << ' ';
	for(int i : nodes)
		cout << i << ' ';
	cout << endl;
	fflush(stdout);

	int x, dist;
	cin >> x >> dist;

	return {x, dist};
}

int main(){
	int t;
	cin >> t;
	while(t--){
		cin >> n;

		for(int i = 1; i <= n; i++)
			adj[i].clear(), depth[i] = 0, max_depth[i] = 0;

		for(int i = 1; i < n; i++){
			int u, v;
			cin >> u >> v;
			adj[u].push_back(v);
			adj[v].push_back(u);
		}

		vector< int > nodes;
		for(int i = 1; i <= n; i++)
			nodes.push_back(i);

		pair< int, int > res = query(nodes);
		root = res.first, dist = res.second;

		dfs(root, 0);

		int st = 0, en = n / 2, first_node = root;
		while(st <= en){
			int mid = st + en >> 1;

			vector< int > node_set;
			find_nodes(root, 0, mid, node_set);

			if(node_set.empty())
				en = mid — 1;
			else{
				pair< int, int > res = query(node_set);
				if(res.second == dist)
					first_node = res.first, st = mid + 1;
				else en = mid — 1;
			}
		}
		vector< int > candidate_second;
		queue< pair< int, int > > q;
		vector< int > vis(n + 1);
		q.push({first_node, 0});
		while(!q.empty()){
			pair< int, int > node = q.front();
			q.pop();
			vis[node.first] = 1;
			if(node.second == dist)
				candidate_second.push_back(node.first);

			for(int j : adj[node.first])
				if(!vis[j])
					vis[j] = 1, q.push({j, node.second + 1});
		}
		pair< int, int > second_node = query(candidate_second);
		cout << "! " << first_node << ' ' << second_node.first << endl;

		string correct;
		cin >> correct;
	}
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dis[root]=0;
		Max=0;
		dfs(root,0);
		int L=0,R=Max/2+1;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		dfs1(idx,0,0,val);
		printf("? %d ",g.size());
		for (int i=0; i<g.size(); i++) {
			printf("%d ",g[i]);
		}
		printf("\n");
		fflush(stdout);
		int idx2;
		scanf("%d%d",&idx2,&val);
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dis[root]=0;
		Max=0;
		dfs(root,0);
		int L=0,R=Max;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		int idx2;
		dfs1(idx,0,0,val);
		if (g.size()>=2) {
			printf("? %d ",g.size());
			for (int i=0; i<g.size(); i++) {
				printf("%d ",g[i]);
			}
			printf("\n");
			fflush(stdout);
			scanf("%d%d",&idx2,&val);
		} else idx2=g[0];
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		Max=0;
		dfs(root,0);
		int L=0,R=Max;
		int idx=root,idx2;
		bool ok=false;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len==val&&val==dis[node]) {
					ok=true;
					idx=root,idx2=node;
					break;
				}
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		if (!ok) {
			dfs1(idx,0,0,val);
			if (g.size()>=2) {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				scanf("%d%d",&idx2,&val);
			} else idx2=g[0];
		}
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dis[root]=0;
		Max=0;
		dfs(root,0);
		int L=0,R=Max;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		int idx2;
		if (g.size()>=2) {
			dfs1(idx,0,0,val);
			printf("? %d ",g.size());
			for (int i=0; i<g.size(); i++) {
				printf("%d ",g[i]);
			}
			printf("\n");
			fflush(stdout);
			scanf("%d%d",&idx2,&val);
		} else idx2=g[0];
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dis[root]=0;
		Max=0;
		dfs(root,0);
		int L=0,R=Max;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		dfs1(idx,0,0,val);
		printf("? %d ",g.size());
		for (int i=0; i<g.size(); i++) {
			printf("%d ",g[i]);
		}
		printf("\n");
		fflush(stdout);
		int idx2;
		scanf("%d%d",&idx2,&val);
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dis[root]=0;
		Max=0;
		dfs(root,0);
		int L=0,R=550;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		dfs1(idx,0,0,val);
		printf("? %d ",g.size());
		for (int i=0; i<g.size(); i++) {
			printf("%d ",g[i]);
		}
		printf("\n");
		fflush(stdout);
		int idx2;
		scanf("%d%d",&idx2,&val);
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dep[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	Max=max(Max,dep[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dep[v]=dep[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dep[root]=0;
		Max=0;
		dfs(root,0);
		int L=(Max+1)/2,R=Max;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			for (int i=1; i<=n; i++) if (dep[i]==m) g.push_back(i);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		dfs1(idx,0,0,val);
		printf("? %d ",g.size());
		for (int i=0; i<g.size(); i++) {
			printf("%d ",g[i]);
		}
		printf("\n");
		fflush(stdout);
		int idx2;
		scanf("%d%d",&idx2,&val);
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dis[root]=0;
		Max=0;
		dfs(root,0);
		int L=0,R=Max;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		dfs1(idx,0,0,val);
		int idx2;
		if (g.size()>=2) {
			printf("? %d ",g.size());
			for (int i=0; i<g.size(); i++) {
				printf("%d ",g[i]);
			}
			printf("\n");
			fflush(stdout);
		} else idx2=g[0];
		scanf("%d%d",&idx2,&val);
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		Max=0;
		dfs(root,0);
		int L=0,R=Max;
		int idx=root,idx2;
		bool ok=false;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len==val&&val==dis[node]) {
					ok=true;
					idx=root,idx2=node;
					break;
				}
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		if (!ok) {
			dfs1(idx,0,0,val);
			printf("? %d ",g.size());
			for (int i=0; i<g.size(); i++) {
				printf("%d ",g[i]);
			}
			printf("\n");
			fflush(stdout);
			scanf("%d%d",&idx2,&val);
		}
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		Max=0;
		dfs(root,0);
		int L=0,R=(Max+1)/2;
		int idx=root,idx2;
		bool ok=false;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len==val&&val==dis[node]) {
					ok=true;
					idx=root,idx2=node;
					break;
				}
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		if (!ok) {
			dfs1(idx,0,0,val);
			printf("? %d ",g.size());
			for (int i=0; i<g.size(); i++) {
				printf("%d ",g[i]);
			}
			printf("\n");
			fflush(stdout);
			scanf("%d%d",&idx2,&val);
		}
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int dep[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dep[v]=dep[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=0; i<maxn; i++) G[i].clear();
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dep[root]=0;
		dfs(root,0);
		int L=0,R=600;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			for (int i=1; i<=n; i++) if (dep[i]==m) g.push_back(i);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		dfs1(idx,0,0,val);
		printf("? %d ",g.size());
		for (int i=0; i<g.size(); i++) {
			printf("%d ",g[i]);
		}
		printf("\n");
		fflush(stdout);
		int idx2;
		scanf("%d%d",&idx2,&val);
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dis[root]=0;
		Max=0;
		dfs(root,0);
		int L=1,R=Max;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		int idx2;
		dfs1(idx,0,0,val);
//		if (g.size()>=2) {
			printf("? %d ",g.size());
			for (int i=0; i<g.size(); i++) {
				printf("%d ",g[i]);
			}
			printf("\n");
			fflush(stdout);
			scanf("%d%d",&idx2,&val);
//		} else idx2=g[0];
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dis[root]=0;
		Max=0;
		dfs(root,0);
		int L=1,R=Max;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		int idx2;
		dfs1(idx,0,0,val);
		if (g.size()>=2) {
			printf("? %d ",g.size());
			for (int i=0; i<g.size(); i++) {
				printf("%d ",g[i]);
			}
			printf("\n");
			fflush(stdout);
			scanf("%d%d",&idx2,&val);
		} else idx2=g[0];
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define pll pair<long long, long long>
#define P pair<int, int>
#define PP pair<P, P>
#define eps 1e-10
#define PI acos(-1)
#define It set<node>::iterator
using namespace std;
const int maxn=1e3+10;
vector<int> G[maxn];
int Max,dis[maxn],f[maxn];
char buf[maxn];
void dfs(int u, int fa) {
	f[u]=fa;
	Max=max(Max,dis[u]);
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
}
vector<int> g;
void solve(int u, int m) {
	if (dis[u]==m) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==f[u]) continue;
		solve(v,m);
	}
}
void dfs1(int u, int fa, int val, int d) {
	if (val==d) {
		g.push_back(u);
		return;
	}
	for (int i=0; i<G[u].size(); i++) {
		int v=G[u][i];
		if (v==fa) continue;
		dfs1(v,u,val+1,d);
	}
}
int main() {
	int t;
	scanf("%d",&t);
	while (t--) {
		int n;
		scanf("%d",&n);
		for (int i=1; i<=n; i++) G[i].clear();
		memset(dis,0,sizeof(dis));
		memset(f,0,sizeof(f));
		for (int i=1; i<n; i++) {
			int u,v;
			scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		printf("? %d ",n);
		for (int i=1; i<=n; i++) printf("%d ",i);
		printf("\n");
		fflush(stdout);
		int root,val;
		scanf("%d%d",&root,&val);
		dis[root]=0;
		Max=0;
		dfs(root,0);
		int L=0,R=500;
		int idx=root;
		while (L<=R) {
			int m=L+(R-L+1)/2;
			g.clear();
			solve(idx,m);
			if (g.empty()) R=m-1;
			else {
				printf("? %d ",g.size());
				for (int i=0; i<g.size(); i++) {
					printf("%d ",g[i]);
				}
				printf("\n");
				fflush(stdout);
				int node,len;
				scanf("%d %d",&node,&len);
				if (len>val) R=m-1;
				else idx=node,L=m+1;
			}
		}
		g.clear();
		dfs1(idx,0,0,val);
		printf("? %d ",g.size());
		for (int i=0; i<g.size(); i++) {
			printf("%d ",g[i]);
		}
		printf("\n");
		fflush(stdout);
		int idx2;
		scanf("%d%d",&idx2,&val);
		printf("! %d %d\n",idx,idx2);
		fflush(stdout);
		scanf("%s",buf);
	}
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
typedef pair< int, int > pii;
pii ask(vector< int >& V) {
	printf("? %d", V.size());
	for (int i = 0; i < V.size(); i++) {
		printf(" %d", V[i]);
	}
	puts("");
	fflush(stdout);
	pii res;
	scanf("%d %d", &res.first, &res.second);
	return res;
}
vector< int > g[maxn];
int d[maxn];
void dfs(int u, int pre) {
	for (int i = 0; i < g[u].size(); i++) {
		int v = g[u][i];
		if (v == pre) continue;
		d[v] = d[u] + 1;
		dfs(v, u);
	}
}
char s[20];
void work(int n) {
	vector< int > V;
	for (int i = 1; i <= n; i++) {
		V.push_back(i);
	}
	pii res = ask(V);
	// cout << "res" << res.first << ' ' << res.second << endl;
	int dis = res.second;
	d[res.first] = 0;
	dfs(res.first, -1);

	int l = (dis + 1) / 2, r = 0;
	for (int i = 1; i <= n; i++) {
		r = max(r, d[i]);
	}
	r = min(r, dis);
	int ans = -1;
	while (l <= r) {
		// cout << l << ' ' << r << endl;
		int mid = l + r >> 1;
		V.clear();
		for (int i = 1; i <= n; i++) {
			if (d[i] == mid) {
				V.push_back(i);
			}
		}
		pii tmp = ask(V);
		if (tmp.second == dis) {
			ans = tmp.first;
			l = mid + 1;
		} else {
			r = mid - 1;
		}
	}
	d[ans] = 0;
	dfs(ans, -1);
	V.clear();
	for (int i = 1; i <= n; i++) {
		if (d[i] == dis) {
			V.push_back(i);
		}
	}
	pii ans2 = ask(V);
	printf("! %d %d\n", ans, ans2.first);
	fflush(stdout);
	scanf("%s", s);
}

int main() {
	int T;
	scanf("%d", &T);
	while (T--) {
		int n;
		scanf("%d", &n);
		for (int i = 1; i <= n; i++) {
			g[i].clear();
			d[i] = 0;
		}
		int u, v;
		for (int i = 1; i < n; i++) {
			scanf("%d %d", &u, &v);
			g[u].push_back(v);
			g[v].push_back(u);
		}
		work(n);
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define i64 long long
#define fp( i, b, e ) for ( int i(b), I(e); i <= I; ++i )
#define fd( i, b, e ) for ( int i(b), I(e); i >= I; --i )
#define go( i, b ) for ( int i(b), v(to[i]); i; v = to[i = nxt[i]] )
template<typename T> inline bool cmax( T &x, T y ){ return x < y ? x = y, 1 : 0; }
template<typename T> inline bool cmin( T &x, T y ){ return y < x ? x = y, 1 : 0; }

const int _ = 1055;
int T, N, D, o, s, dep[_], fa[_];
int hd[_], nxt[_<<1], to[_<<1], tot;
vector<int> vec[_];
bool tg[_];
string str;

void addedge( int x, int y ){
	nxt[++tot] = hd[x], hd[x] = tot, to[tot] = y;
}

void DFS( int u ){
	vec[dep[u]].push_back(u), cmax(D, dep[u]);
	go( i, hd[u] ) if ( v != fa[u] ) fa[v] = u, dep[v] = dep[u] + 1, DFS(v);
}

int main(){
	cin >> T;
	while( T-- ){
		scanf( "%d", &N ); int x, y; tot = 0;
		fp( i, 0, 1000 ) vec[i].clear(), tg[i] = fa[i] = hd[i] = dep[i] = 0;
		fp( i, 1, N - 1 ) scanf( "%d%d", &x, &y ), addedge(x, y), addedge(y, x);

		cout << "? " << N; fp( i, 1, N ) cout << " " << i; cout << endl; cin >> o >> s;
		if ( o < 0 && s < 0 ) return cout << "FUCK YOU!" << endl, 0;

		D = 0, DFS(o); int l(s >> 1), r(min(s, D)), mid, ans(-1);
		while( l <= r ){
			mid = (l + r) >> 1;
			cout << "? " << vec[mid].size(); for ( int i : vec[mid] ) cout << " " << i; cout << endl; cin >> x >> y;
			if ( x < 0 && y < 0 ) return cout << "FUCK YOU!" << endl, 0;
			if ( y <= s ) ans = x, l = mid + 1; else r = mid - 1;
		}
		for ( int i = ans; i != o; i = fa[i] ) tg[i] = 1;
		cout << "? "<< vec[s - dep[ans]].size() - (s != dep[ans]); for ( int i : vec[s - dep[ans]] ) if ( !tg[i] ) cout << " " << i; cout << endl;
		cin >> x >> y; cout << "! " << x << " " << ans << endl;
		cin >> str; if ( str == "Incorrect" ) return 0;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define i64 long long
#define fp( i, b, e ) for ( int i(b), I(e); i <= I; ++i )
#define fd( i, b, e ) for ( int i(b), I(e); i >= I; --i )
#define go( i, b ) for ( int i(b), v(to[i]); i; v = to[i = nxt[i]] )
template<typename T> inline bool cmax( T &x, T y ){ return x < y ? x = y, 1 : 0; }
template<typename T> inline bool cmin( T &x, T y ){ return y < x ? x = y, 1 : 0; }

const int _ = 1055;
int T, N, D, o, s, dep[_], fa[_];
int hd[_], nxt[_<<1], to[_<<1], tot;
vector<int> vec[_];
bool tg[_];
string str;

void addedge( int x, int y ){
	nxt[++tot] = hd[x], hd[x] = tot, to[tot] = y;
}

void DFS( int u ){
	vec[dep[u]].push_back(u), cmax(D, dep[u]);
	go( i, hd[u] ) if ( v != fa[u] ) fa[v] = u, dep[v] = dep[u] + 1, DFS(v);
}

int main(){
	cin >> T;
	while( T-- ){
		scanf( "%d", &N ); int x, y; tot = 0;
		fp( i, 0, 1000 ) vec[i].clear(), tg[i] = fa[i] = hd[i] = dep[i] = 0;
		fp( i, 1, N - 1 ) scanf( "%d%d", &x, &y ), addedge(x, y), addedge(y, x);

		cout << "? " << N; fp( i, 1, N ) cout << " " << i; cout << endl; cin >> o >> s;

		D = 0, DFS(o); int l(s >> 1), r(s), mid, ans(-1);
		while( l <= r ){
			mid = (l + r) >> 1;
			cout << "? " << vec[mid].size(); for ( int i : vec[mid] ) cout << " " << i; cout << endl; cin >> x >> y;
			if ( y <= s ) ans = x, l = mid + 1; else r = mid - 1;
		}
		for ( int i = ans; i != o; i = fa[i] ) tg[i] = 1;
		cout << "? "<< vec[s - dep[ans]].size() - (s != dep[ans]); for ( int i : vec[s - dep[ans]] ) if ( !tg[i] ) cout << " " << i; cout << endl;
		cin >> x >> y; cout << "! " << x << " " << ans << endl;
		cin >> str; if ( str == "Inorrect" ) break;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define i64 long long
#define fp( i, b, e ) for ( int i(b), I(e); i <= I; ++i )
#define fd( i, b, e ) for ( int i(b), I(e); i >= I; --i )
#define go( i, b ) for ( int i(b), v(to[i]); i; v = to[i = nxt[i]] )
template<typename T> inline bool cmax( T &x, T y ){ return x < y ? x = y, 1 : 0; }
template<typename T> inline bool cmin( T &x, T y ){ return y < x ? x = y, 1 : 0; }

const int _ = 1055;
int T, N, D, o, s, dep[_], fa[_];
int hd[_], nxt[_<<1], to[_<<1], tot;
vector<int> vec[_];
bool tg[_];
string str;

void addedge( int x, int y ){
	nxt[++tot] = hd[x], hd[x] = tot, to[tot] = y;
}

void DFS( int u ){
	vec[dep[u]].push_back(u), cmax(D, dep[u]);
	go( i, hd[u] ) if ( v != fa[u] ) fa[v] = u, dep[v] = dep[u] + 1, DFS(v);
}

int main(){
	cin >> T;
	while( T-- ){
		scanf( "%d", &N ); int x, y; tot = 0;
		fp( i, 0, 1000 ) vec[i].clear(), tg[i] = fa[i] = hd[i] = dep[i] = 0;
		fp( i, 1, N - 1 ) scanf( "%d%d", &x, &y ), addedge(x, y), addedge(y, x);

		cout << "? " << N; fp( i, 1, N ) cout << " " << i; cout << endl; cin >> o >> s;
		if ( o < 0 && s < 0 ) return cout << "FUCK YOU!" << endl, 0;

		D = 0, DFS(o); int l(s >> 1), r(s), mid, ans(-1);
		while( l <= r ){
			mid = (l + r) >> 1;
			cout << "? " << vec[mid].size(); for ( int i : vec[mid] ) cout << " " << i; cout << endl; cin >> x >> y;
			if ( x < 0 && y < 0 ) return cout << "FUCK YOU!" << endl, 0;
			if ( y <= s ) ans = x, l = mid + 1; else r = mid - 1;
		}
		for ( int i = ans; i != o; i = fa[i] ) tg[i] = 1;
		cout << "? "<< vec[s - dep[ans]].size() - (s != dep[ans]); for ( int i : vec[s - dep[ans]] ) if ( !tg[i] ) cout << " " << i; cout << endl;
		cin >> x >> y; cout << "! " << x << " " << ans << endl;
		cin >> str; if ( str == "Incorrect" ) return 0;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int M = 1e3 + 10;
int t, n, mx, ans1, ans2;
vector<int> g[M], s[M];
string cor;
void clearing()
{
    for (int i = 0; i <= n; i++)
        g[i].clear(), s[i].clear();
    mx = 0;
}
pair<int, int> query(int i)
{
    cout << "? " << s[i].size() << " ";
    for (auto x : s[i])
        cout << x << " ";
    cout << endl;
    int x, y;
    cin >> x >> y;
    return {x, y};
}
void dfs(int v, int par, int dep)
{
    mx = max(mx, dep);
    s[dep].push_back(v);
    for (auto u : g[v])
        if (u != par)
            dfs(u, v, dep + 1);
}
int32_t main()
{
    cin >> t;
    while (t--)
    {
        cin >> n;
        for (int i = 1; i < n; i++)
        {
            int u, v;
            cin >> u >> v;
            g[u].push_back(v);
            g[v].push_back(u);
        }
        for (int i = 1; i <= n; i++)
            s[n].push_back(i);
        auto p = query(n);
        dfs(p.first, p.first, 0);
        int l = max(p.second / 2 - 3, 0), r = min(p.second + 1, mx + 1), mid;
        ans1 = p.first;
        while (r - l > 1)
        {
            mid = (l + r) / 2;
            auto q = query(mid);
            if (q.second == p.second)
            {
                l = mid;
                ans1 = q.first;
            }
            else
                r = mid;
        }
        s[p.second].clear();
        dfs(ans1, ans1, 0);
        ans2 = query(p.second).first;
        cout << "! " << ans1 << " " << ans2 << endl;
        cin >> cor;
        clearing();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define f1(a, b, c) for (int c = a; c <= b; c++)
#define f2(a, b, c) for (int c = a; c >= b; c--)
#define f3(a, b, c) for (int c = a; c; c = b)
#define so1(a, n) sort(a + 1, a + n + 1, mycmp);
#define so2(a, n) sort(a + 1, a + n + 1);
#define re(a, n) reverse(a + 1, a + n + 1);
#define ll long long
#define itn int
#define ubt int
#define mp make_pair
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define DEBUG puts("FUCK");
const int twx = 1e3 + 100;
const int inf = 0x3f3f3f3f;
ll read()
{
    ll sum = 0;
    ll flag = 1;
    char c = getchar();
    while (c < '0' || c > '9')
    {
        if (c == '-')
        {
            flag = -1;
        }
        c = getchar();
    }
    while (c >= '0' && c <= '9')
    {
        sum = ((sum * 10) + c - '0');
        c = getchar();
    }
    return sum * flag;
}
int T;
int n;
int root;
int dist;
vector<int> adj[twx];
vector<int> depth(twx);
vector<int> MAX_depth(twx);
void dfs(int i, int par)
{
    MAX_depth[i] = depth[i];
    for (int j : adj[i])
    {
        if (j == par)
            continue;
        depth[j] = 1 + depth[i], dfs(j, i);
        MAX_depth[i] = max(MAX_depth[i], MAX_depth[j]);
    }
}

void find_nodes(int i, int par, int req_depth, vector<int> &nodes)
{
    if (depth[i] == req_depth)
    {
        nodes.push_back(i);
        return;
    }
    for (int j : adj[i])
        if (j != par && MAX_depth[j] <= n / 2)
            find_nodes(j, i, req_depth, nodes);
}

pair<int,int> query(vector<int> nodes)
{
    cout << "? " << nodes.size() << ' ';
    for (int i : nodes)
        cout << i << ' ';
    cout << endl;
    fflush(stdout);

    int x, dist;
    cin >> x >> dist;

    return {x, dist};
}
void init()
{
    T = read();
    while (T--)
    {
        n = read();
        f1(1, n, i)
        {
            adj[i].clear();
            depth[i] = 0;
            MAX_depth[i] = 0;
        }
        f1(1, n, i)
        {
            int x = read();
            int y = read();
            adj[x].pb(y);
            adj[y].pb(x);
        }
        vector<int> nodes;
        f1(1, n, i)
        {
            nodes.pb(i);
        }
        pii res = query(nodes);
        root = res.first, dist = res.second;
        dfs(root, 0);

        int st = 0, en = n / 2, first_node = root;
        while (st <= en)
        {
            int mid = st + en >> 1;

            vector<int> node_set;
            find_nodes(root, 0, mid, node_set);

            if (node_set.empty())
                en = mid - 1;
            else
            {
                pair<int, int> res = query(node_set);
                if (res.second == dist)
                    first_node = res.first, st = mid + 1;
                else
                    en = mid - 1;
            }
        }
        vector<int> candidate_second;
        queue<pair<int, int>> q;
        vector<int> vis(n + 1);
        q.push({first_node, 0});
        while (!q.empty())
        {
            pair<int, int> node = q.front();
            q.pop();
            vis[node.first] = 1;
            if (node.second == dist)
                candidate_second.push_back(node.first);

            for (int j : adj[node.first])
                if (!vis[j])
                    vis[j] = 1, q.push({j, node.second + 1});
        }
        pair<int, int> second_node = query(candidate_second);
        cout << "! " << first_node << ' ' << second_node.first << endl;

        string correct;
        cin >> correct;
    }
}
void work()
{
}
void print()
{
}
int main()
{
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    init();
    work();
    print();
    return 0;
}


#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
#define all(v) (v).begin(), (v).end()
#define unq(v) (v).erase(unique(all(v)), (v).end())
#define ii int, int
#define li int, int
#define ll2 ll, ll
#define vec vector
#define pii pair <int, int>
#define pli pair <ll, int>
#define pll2 pair <ll, ll>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define MULTI int T; cin >> T; while(T--)
#define sqr(x) ((x) * (x))
#define test cerr << '!' << endl;
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

int main0 ();
int main () {
	#ifndef ONLINE_JUDGE
		//freopen("C:\\Users\\98497\\Desktop\\code\\file.in", "r", stdin);
	#endif
	ios::sync_with_stdio(false);
	clock_t start, end;
	// start = clock();
	main0();
	// end = clock();
	// cout << (end - start) << endl;
	#ifndef ONLINE_JUDGE
		//fclose(stdin);
	#endif
	return 0;
}

const int dx[8] = {0, 1, -1, 0, 1, 1, -1, -1};
const int dy[8] = {1, 0, 0, -1, 1, -1, -1, 1};
const int N = 2e5 + 5;
const int M = 1e5;
const int INF = 0x3f3f3f3f;
const ll INFF = 0x3f3f3f3f3f3f3f3f;
const int mod = 998244353;

int q[N];
vec <int> e[N];
int dis[N], maxdep;
int dis2[N];
int may[N];

void query () {
	cout << "?";
	for (int i = 0;i <= q[0];++i) {
		cout << ' ' << q[i];
	}
	cout << endl;
	fflush(stdout);
}

void dfs (int u, int fa) {
	for (auto v : e[u]) if (v != fa) {
		maxdep = max(maxdep, dis[v] = dis[u] + 1);
		dfs(v, u);
	}
}

void dfs2 (int u, int fa) {
	for (auto v : e[u]) if (v != fa) {
		dis2[v] = dis2[u] + 1;
		dfs2(v, u);
	}
}

int main0 () {
	MULTI {
		int n;
		cin >> n;
		for (int i = 1;i <= n;++i) {
			e[i].clear();
			dis[i] = dis2[i] = 0;
		}
		maxdep = 0;
		for (int i = 1;i < n;++i) {
			int u, v;
			cin >> u >> v;
			e[u].pb(v);
			e[v].pb(u);
		}

		q[0] = n;
		for (int i = 1;i <= n;++i) {
			q[i] = i;
		}
		query();
		int rt, disuv;
		cin >> rt >> disuv;

		dfs(rt, -1);
		int l = disuv / 2, r = min(maxdep, disuv);
		int ans1, curu, curdis;
		while (l <= r) {
			int mid = (l + r) / 2;
			q[0] = 0;
			for (int i = 1;i <= n;++i) if (dis[i] >= mid) {
				q[++q[0]] = i;
			}
			if (!q[0]) {
				r = mid - 1;
				continue;
			}
			query();
			cin >> curu >> curdis;
			if (curdis == disuv) {
				ans1 = curu;
				l = mid + 1;
			} else r = mid - 1;
		}

		q[0] = 0;
		dfs2(ans1, -1);
		for (int i = 1;i <= n;++i) if (dis2[i] == disuv) {
			q[++q[0]] = i;
		}
		query();
		int ans2;
		cin >> ans2 >> curdis;
		cout << "! " << ans1 << ' ' << ans2 << endl;

		string ret;
		cin >> ret;
	}
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define ls (o<<1)
#define rs (o<<1|1)
#define pb push_back
const double PI= acos(-1.0);
const int M = 1e3+7;

int head[M],cnt=1;
void init(){cnt=1,memset(head,0,sizeof(head));}
struct EDGE{int to,nxt,w;}ee[M*2];
void add(int x,int y,int w){ee[++cnt].nxt=head[x],ee[cnt].w=w,ee[cnt].to=y,head[x]=cnt;}

int a[M],sz;
int n,m;
int dep[M];
int rt,d,tid;
pii ask()
{
	cout<<"?";
	for(int i=1;i<=sz;i++)cout<<" "<<a[i];
	cout<<endl;
	int x,y;
	cin>>x>>y;
	return {x,y};
}
void dfs(int x,int fa)
{
	for(int i=head[x];i;i=ee[i].nxt)
	{
		int y=ee[i].to;
		if(y==fa)continue;
		dep[y]=dep[x]+1;
		dfs(y,x);
	}
}
bool ck(int x)//在深度x的点中，有无在隐藏点路径上的点
{
	sz=0;for(int i=1;i<=n;i++)if(dep[i]==x)a[++sz]=i;
	pii tp=ask();
	if(tp.second!=d)return false;
	tid=tp.first;
	return true;
}
void gao(int x,int fa,int p)
{
	if(p==d){
		a[++sz]=x;
		return ;
	}
	for(int i=head[x];i;i=ee[i].nxt)
	{
		int y=ee[i].to;
		if(y==fa)continue;
		gao(y,x,p+1);
	}
}

int main()
{
	ios::sync_with_stdio(false);
  	cin.tie(0);
  	int t;
	cin>>t;
	while(t--)
	{
		cin>>n;
		init();
		for(int i=1;i<n;i++){
			int u,v;
			cin>>u>>v;
			add(u,v,1),add(v,u,1);
		}
		sz=0;for(int i=1;i<=n;i++)a[++sz]=i;
		pii tp = ask();
		rt=tp.first,d=tp.second;
		dep[rt]=0;dfs(rt,0);
		int l=(d+1)/2,r=d,ans=0,id=0;
		while(l<=r)
		{
		//	cout<<rt<<" "<<dep[1]<<" "<<dep[2]<<" "<<dep[3]<<" ==   "<<l<< " -  "<<r<<endl;
			int mid=(l+r)/2;
			if(ck(mid))id=tid,ans=mid,l=mid+1;//仍然能找到在路径上的点
			else r=mid-1;
		}
		sz=0;gao(id,0,0);
		tp = ask();
		cout<<"! "<<id<<" "<<tp.first<<endl;
		char s[111];
		cin>>s;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define ls (o<<1)
#define rs (o<<1|1)
#define pb push_back
const double PI= acos(-1.0);
const int M = 1e3+7;

int head[M],cnt=1;
void init(){cnt=1,memset(head,0,sizeof(head));}
struct EDGE{int to,nxt,w;}ee[M*2];
void add(int x,int y,int w){ee[++cnt].nxt=head[x],ee[cnt].w=w,ee[cnt].to=y,head[x]=cnt;}

int a[M],sz;
int n,m;
int dep[M];
int rt,d,tid;
pii ask()
{
	cout<<"?";
	cout<<" "<<sz;
	for(int i=1;i<=sz;i++)cout<<" "<<a[i];
	cout<<endl;
	int x,y;
	cin>>x>>y;
	return {x,y};
}
void dfs(int x,int fa)
{
	for(int i=head[x];i;i=ee[i].nxt)
	{
		int y=ee[i].to;
		if(y==fa)continue;
		dep[y]=dep[x]+1;
		dfs(y,x);
	}
}
bool ck(int x)//在深度x的点中，有无在隐藏点路径上的点
{
	sz=0;for(int i=1;i<=n;i++)if(dep[i]==x)a[++sz]=i;
	pii tp=ask();
	if(tp.second!=d)return false;
	tid=tp.first;
	return true;
}
void gao(int x,int fa,int p)
{
	if(p==d){
		a[++sz]=x;
		return ;
	}
	for(int i=head[x];i;i=ee[i].nxt)
	{
		int y=ee[i].to;
		if(y==fa)continue;
		gao(y,x,p+1);
	}
}

int main()
{
	ios::sync_with_stdio(false);
  	cin.tie(0);
  	int t;
	cin>>t;
	while(t--)
	{
		cin>>n;
		init();
		for(int i=1;i<n;i++){
			int u,v;
			cin>>u>>v;
			add(u,v,1),add(v,u,1);
		}
		sz=0;for(int i=1;i<=n;i++)a[++sz]=i;
		pii tp = ask();
		rt=tp.first,d=tp.second;
		dep[rt]=0;dfs(rt,0);
		int l=(d+1)/2,r=d,id=rt;
		while(l<=r)
		{
		//	cout<<rt<<" "<<dep[1]<<" "<<dep[2]<<" "<<dep[3]<<" ==   "<<l<< " -  "<<r<<endl;
			int mid=(l+r)/2;
			if(ck(mid))id=tid,l=mid+1;//仍然能找到在路径上的点
			else r=mid-1;
		}
		sz=0;gao(id,0,0);
		tp = ask();
		cout<<"! "<<id<<" "<<tp.first<<endl;
		char s[111];
		cin>>s;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define ls (o<<1)
#define rs (o<<1|1)
#define pb push_back
const double PI= acos(-1.0);
const int M = 1e3+7;

int head[M],cnt=1;
void init(){cnt=1,memset(head,0,sizeof(head));}
struct EDGE{int to,nxt,w;}ee[M*2];
void add(int x,int y,int w){ee[++cnt].nxt=head[x],ee[cnt].w=w,ee[cnt].to=y,head[x]=cnt;}

int a[M],sz;
int n,m;
int dep[M];
int rt,d,tid;
pii ask()
{
	cout<<"?";
	cout<<" "<<sz;
	for(int i=1;i<=sz;i++)cout<<" "<<a[i];
	cout<<endl;
	int x,y;
	cin>>x>>y;
	return {x,y};
}
void dfs(int x,int fa)
{
	for(int i=head[x];i;i=ee[i].nxt)
	{
		int y=ee[i].to;
		if(y==fa)continue;
		dep[y]=dep[x]+1;
		dfs(y,x);
	}
}
bool ck(int x)//在深度x的点中，有无在隐藏点路径上的点
{
	sz=0;for(int i=1;i<=n;i++)if(dep[i]==x)a[++sz]=i;
	pii tp=ask();
	if(tp.second!=d)return false;
	tid=tp.first;
	return true;
}
void gao(int x,int fa,int p)
{
	if(p==d){
		a[++sz]=x;
		return ;
	}
	for(int i=head[x];i;i=ee[i].nxt)
	{
		int y=ee[i].to;
		if(y==fa)continue;
		gao(y,x,p+1);
	}
}

int main()
{
	ios::sync_with_stdio(false);
  	cin.tie(0);
  	int t;
	cin>>t;
	while(t--)
	{
		cin>>n;
		init();
		for(int i=1;i<n;i++){
			int u,v;
			cin>>u>>v;
			add(u,v,1),add(v,u,1);
		}
		sz=0;for(int i=1;i<=n;i++)a[++sz]=i;
		pii tp = ask();
		rt=tp.first,d=tp.second;
		dep[rt]=0;dfs(rt,0);
		int l=(d+1)/2,r=d,ans=0,id=0;
		while(l<=r)
		{
		//	cout<<rt<<" "<<dep[1]<<" "<<dep[2]<<" "<<dep[3]<<" ==   "<<l<< " -  "<<r<<endl;
			int mid=(l+r)/2;
			if(ck(mid))id=tid,ans=mid,l=mid+1;//仍然能找到在路径上的点
			else r=mid-1;
		}
		sz=0;gao(id,0,0);
		tp = ask();
		cout<<"! "<<id<<" "<<tp.first<<endl;
		char s[111];
		cin>>s;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int M = 1e3+7;

int head[M],cnt=1;
void init(){cnt=1,memset(head,0,sizeof(head));}
struct EDGE{int to,nxt,w;}ee[M*2];
void add(int x,int y,int w){ee[++cnt].nxt=head[x],ee[cnt].w=w,ee[cnt].to=y,head[x]=cnt;}

int a[M],sz;
int n,m;
int dep[M];
int rt,d,tid;
pii ask()
{
	cout<<"?";
	cout<<" "<<sz;
	for(int i=1;i<=sz;i++)cout<<" "<<a[i];
	cout<<endl;
	int x,y;
	cin>>x>>y;
	return {x,y};
}
void dfs(int x,int fa)
{
	for(int i=head[x];i;i=ee[i].nxt)
	{
		int y=ee[i].to;
		if(y==fa)continue;
		dep[y]=dep[x]+1;
		dfs(y,x);
	}
}
bool ck(int x)//在深度x的点中，有无在隐藏点路径上的点
{
	sz=0;for(int i=1;i<=n;i++)if(dep[i]==x)a[++sz]=i;
	if(sz==0)return false;
	pii tp=ask();
	if(tp.second!=d)return false;
	tid=tp.first;
	return true;
}
void gao(int x,int fa,int p)
{
	if(p==d){
		a[++sz]=x;
		return ;
	}
	for(int i=head[x];i;i=ee[i].nxt)
	{
		int y=ee[i].to;
		if(y==fa)continue;
		gao(y,x,p+1);
	}
}

int main()
{
	ios::sync_with_stdio(false);
  	cin.tie(0);
  	int t;
	cin>>t;
	while(t--)
	{
		cin>>n;
		init();
		for(int i=1;i<n;i++){
			int u,v;
			cin>>u>>v;
			add(u,v,1),add(v,u,1);
		}
		sz=0;for(int i=1;i<=n;i++)a[++sz]=i;
		pii tp = ask();
		rt=tp.first,d=tp.second;
		dep[rt]=0;dfs(rt,0);
		int l=(d+1)/2,r=d,id=rt;
		while(l<=r)
		{
		//	cout<<rt<<" "<<dep[1]<<" "<<dep[2]<<" "<<dep[3]<<" ==   "<<l<< " -  "<<r<<endl;
			int mid=(l+r)/2;
			if(ck(mid))id=tid,l=mid+1;//仍然能找到在路径上的点
			else r=mid-1;
		}
		sz=0;gao(id,0,0);
		tp = ask();
		cout<<"! "<<id<<" "<<tp.first<<endl;
		char s[111];
		cin>>s;
	}
	return 0;
}
/*
4

2 3
3 1
3 4

4 2
*/


#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
int n,t,mx_dp;
vector<int> e[1001];
vector<int> dp[1001];
void dfs(int u,int f,int dp_)
{
	dp[dp_].push_back(u);
	for(int i=0;i<e[u].size();i++)
	if(e[u][i]!=f)
	dfs(e[u][i],u,dp_+1);
	if(dp_>mx_dp)
	mx_dp=dp_;
	return ;
}
int main()
{
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d",&n);
		mx_dp=0;
		for(int i=1;i<=n;i++)
		{
			e[i].clear();
			dp[i].clear();
		}
		for(int i=1;i<n;i++)
		{
			int x,y;
			scanf("%d%d",&x,&y);
			e[x].push_back(y);
			e[y].push_back(x);
		}
		printf("?");
		printf(" %d",n);
		for(int i=1;i<=n;i++)
		printf(" %d",i);
		printf("\n");
		fflush(stdout);
		int x,d;
		scanf("%d%d",&x,&d);
		dfs(x,0,1);
		int l=1,r=mx_dp,md=0,ns=0,ns_;
		if(r>500) r=500;
		while(l<=r)
		{
			md=(l+r)>>1;
			printf("?");
			printf(" %d",dp[md].size());
			for(int i=0;i<dp[md].size();i++)
			printf(" %d",dp[md][i]);
			printf("\n");
			fflush(stdout);
			int _x,_d;
			scanf("%d%d",&_x,&_d);
			if(_d>d)
			{
				r=md-1;
				continue;
			}
			l=md+1;
			ns=md; ns_=_x;
		}
		//cout<<"ns_="<<ns_<<endl;
		//ns_ is the one
		mx_dp=0;
		for(int i=1;i<=n;i++)
		dp[i].clear();
		dfs(ns_,0,1);
		l=1,r=mx_dp,md=0,ns=0;
		int ns__;
		l=r=d+1;
		while(l<=r)
		{
			md=(l+r)>>1;
			printf("?");
			printf(" %d",dp[md].size());
			for(int i=0;i<dp[md].size();i++)
			printf(" %d",dp[md][i]);
			printf("\n");
			fflush(stdout);
			int _x,_d;
			scanf("%d%d",&_x,&_d);
			if(_d>d)
			{
				r=md-1;
				continue;
			}
			l=md+1;
			ns=md; ns__=_x;
		}
		//cout<<"ns__="<<ns__<<endl;
		printf("! %d %d\n",ns_,ns__);
		string Correct="";
		fflush(stdout);
		cin>>Correct;
	}
	return 0;
}


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

#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)

mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());

template <typename T>
inline void chkmax(T &x, T y) { if (x < y) x = y; }

template <typename T>
inline void chkmin(T &x, T y) { if (x > y) x = y; }

inline int read() {
  #define nc getchar()
  int x = 0;
  char c = nc;
  while (c < 48) c = nc;
  while (c > 47) x = x * 10 + (c ^ 48), c = nc;
  return x;
  #undef nc
}

typedef long long ll;
const int maxn = 1010;
int n;
int rt, len;

vector <int> E[maxn], vec[maxn];

int maxd, fa[maxn], dep[maxn];

void dfs(int u, int f) {
  fa[u] = f;
  chkmax(maxd, dep[u]);
  vec[dep[u]].push_back(u);
  for (int v : E[u]) if (v != f) {
    dep[v] = dep[u] + 1, dfs(v, u);
  }
}

typedef pair <int, int> pii;
pii ans[maxn];

pii query(int dep) {
  assert(!vec[dep].empty());
  if (ans[dep].first != 0) return ans[dep];
  printf("? %d ", (int) vec[dep].size());
  for (int u : vec[dep]) printf("%d ", u);
  puts("");
  fflush(stdout);
  int x, d;
  scanf("%d %d", &x, &d);
  if (x == -1 || d == -1) assert(0);
  return ans[dep] = pii(x, d);
}

void solve() {
  scanf("%d", &n);
  memset(ans, 0, sizeof ans);
  rep(i, 0, n) E[i].clear(), vec[i].clear();
  rep(i, 2, n) {
    int u, v;
    scanf("%d %d", &u, &v);
    E[u].push_back(v), E[v].push_back(u);
  }
  printf("? %d ", n);
  rep(i, 1, n) printf("%d ", i);
  puts("");
  fflush(stdout);
  scanf("%d %d", &rt, &len);
  maxd = dep[rt] = 0, dfs(rt, 0);
  int l = (len - 1) / 2 + 1, r = min(len, maxd), pos = rt;
  while (l <= r) {
    int mid = (l + r) >> 1;
    pii p = query(mid);
    p.second == len ? pos = p.first, l = mid + 1 : r = mid - 1;
  }
  int tmp = len - dep[pos];
  static bool vis[maxn];
  memset(vis, 0, sizeof vis);
  for (int u = pos; u; u = fa[u]) {
    vis[u] = 1;
  }
  vector <int> seq;
  for (int u : vec[tmp]) if (!vis[u] || u == rt) seq.push_back(u);
  if (seq.empty()) assert(0);
  printf("? %d ", (int) seq.size());
  for (int u : seq) printf("%d ", u);
  puts("");
  fflush(stdout);
  int x, d;
  scanf("%d %d", &x, &d);
  assert(d == len);
  if (x == -1) assert(0);
  printf("! %d %d\n", pos, x);
  fflush(stdout);
  char data[15];
  scanf("%s", data);
  if (*data != 'C') assert(0);
  fflush(stdout);
}

int main() {
  int T = read();
  while (T--) solve();
//  solve();
  return 0;
}


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

#define FASTIO  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ll long long int
#define ld long double
#define vll vector<ll>
#define it(r,v) for(auto r=v.begin();r!=v.end();r++)
#define l(i,a,b) for(int i=a;i<b;i++)
#define L(i,a,b) for(int i=a;i<=b;i++)
#define r(i,a,b) for(int i=a;i>=b;i--)
#define R(i,a,b) for(int i=a;i>b;i--)
#define scanl(a) scanf("%lld",&a)
#define scani(a) scanf("%d",&a)
#define scanll(a,b) scanf("%lld %lld",&a,&b)
#define scanil(a,b) scanf("%d %lld",&a,&b)
#define pr(a) cout<<a<<" "<<endl;
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
#define pr3(a,b,c) cout<<a<<" a "<<b<<" b "<<c<<"\n"
#define input(a,n) l(i,0,n) cin>>a[i];
const int N = int(5*1e5+3);

long long int mod = 1e8+7;

//long long int mod = 1000000000;
//ll mod=998244353;
long long  int power(long long int x,long long int y)
{
    if(y==0) return 1;
    if(y%2==0) return power(x*x%mod,y/2)%mod;
    else return x*power(x*x%mod,y/2)%mod;
}

long long int GCD(long long int a,long long  int b)
{
    if (a == 0)
        return b;
    return GCD(b % a, a);
}

/*
int n=10;
struct node1 {
    long long int sum,prefix,suffix;
    sum=prefix=suffix=0;
};
struct node1 tree[2*n+2];

void join(int node){
    int l=2*node,r=l+1;
    tree[node].sum = tree[l].sum+tree[r].sum;
    tree[node].prefix = max(tree[l].prefix,tree[l].sum+tree[r].prefix);
    tree[node].suffix = max(tree[r].suffix,tree[l].suffix+tree[r].sum);
}

void build(int node , int l ,int r){
    if(l==r){
        tree[node].sum = a[l];
        tree[node].prefix = max(0,a[l]);
        tree[node].suffix = max(0,a[l]);
    } else {
        int mid = (l+r)/2;
        auto first,second;
        build(2*node,l,mid);
        build(2*node+1,mid+1,r);
        join(node,2*node,2*node+1);
    }
}

void update(int node,int l,int r,int p){
    if(l>r){
        return ;
    } else if(l==p && r==p){
        tree[node].sum=a[p];
        tree[node].prefix=max(0,a[p]);
        tree[node].suffix = max(0,a[p]);
    } else {
        int mid = (l+r)/2;
        update(2*node,l,mid,p);
        update(2*node+1,mid+1,r,p);
        join(node);
    }
}

node1 query(int node,int l,int r, int start,int last){
    if(start<=l && last>=r){
        return tree[node];
    } else if(l>r){
        return null;
    }
    int mid = (l+r)/2;
    auto first,second;
    first= query(2*node,l,mid,start,last);
    second = query(2*node+1,mid+1,r,start,last);
    join
}
*/

/*
void bfs(int s,int f){
    visit[s]=true;
    dp[s]=f;
    if(f%2) od.push_back(s);
    else ev.push_back(s);
    for(auto i: vect[s]){
        if(!visit[i]){
            parent[i]=s;
            bfs(i,f+1);
        }else if(parent[s]!=i){
            l=s;
            r=i;
            return;
        }
        if(l!=-1)
                return;
    }
}

int maint(){
    int n,m,k;
    cin>>n>>m>>k;
    int a,b;
    l(i,0,m){
        cin>>a>>b;
        vect[a].push_back(b);
        vect[b].push_back(a);
    }
    bfs(1,1);
    //pr2(l,r);
    if(l==-1){
        cout<<1<<endl;
        if(od.size()>ev.size()){
            for(int i=0;i<k/2+k%2;i++){
                cout<<od[i]<<" ";
            }
        }else
            for(int i=0;i<k/2+k%2;i++){
                cout<<ev[i]<<" ";
            }
        cout<<endl;
    }else {
        od.clear(),ev.clear();
        vector<int> kit,sit;
        if(dp[l]<dp[r]){
            //pr2(dp[l],dp[r]);
            swap(l,r);
        }
        //pr2(dp[l],dp[r]);
        while(dp[l]!=dp[r]){
            if(dp[l]%2) od.push_back(l);
            else ev.push_back(l);
            //pr2(dp[l],dp[r]);
            kit.push_back(l);
            l=parent[l];
        }
        if(dp[l]==dp[r] ){
            while(l!=r){
                if(dp[l]%2) od.push_back(l);
                else ev.push_back(l);
                if(dp[r]%2) od.push_back(r);
                else ev.push_back(r);
                kit.push_back(l);
                sit.push_back(r);
                l=parent[l];
                r=parent[r];
            }
            if(dp[l]%2) od.push_back(l);
            else ev.push_back(l);
        }
        if(kit.size()+sit.size()<=k){
            cout<<2<<endl;
            cout<<kit.size()+sit.size()<<endl;
            for(auto it=sit.rbegin();it!=sit.rend();it++){
                cout<<*it<<" ";
            }
            for(auto it: kit){
                cout<<it<<" ";
            }
        } else {
            cout<<1<<endl;
            for(int i=0;i<k/2+k%2;i++){
                cout<<od[i]<<" ";
            }
            cout<<endl;
        }
    }

}
*/

int main(){
    FASTIO;
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        vector<int> vect[n+1];
        bool visit[n+1];
        int par[n+1],pos[n+1];
        int x,y;
        l(i,0,n-1) {
            visit[i+1]=false;
            cin>>x>>y;
            vect[x].push_back(y);
            vect[y].push_back(x);
        }
        cout<<"? "<<n<<" ";
        l(i,1,n+1){
            cout<<i<<" ";
        }
        cout<<endl;
        cin>>x>>y;
        cout.flush();
        pos[x]=0;
        string str;
        if(y==0){
            cout<<"! "<<x<<" "<<x<<endl;
            cin>>str;
            cout.flush();
            continue;
        }
        queue<int> qu;
        qu.push(x);
        vector<int> v[n+1];
        int s;
        v[0].push_back(x);
        while(qu.size()){
            s= qu.front();
            qu.pop();
            visit[s]=true;
            for(auto i: vect[s]){
                if(!visit[i]){
                    qu.push(i);
                    par[i]=s;
                    pos[i]=pos[s]+1;
                    v[pos[i]].push_back(i);
                }
            }
        }
        int small=-1,big=0;
        cout.flush();
        l(i,1,n+1){
            if(v[i].size()==0){
                break;
            }else if(v[i].size()>1){
                small=i;
            }
            if(v[i].size()){
                big=i;
            }
        }
        int l,r;
        r=min(big,y);
        if(small==-1){
            cout<<"! "<<x<<" "<<v[y][0]<<endl;
            cin>>str;
            cout.flush();
            continue;
        }
        int d = y-small;
        if(d<0){
            l=1;
        }else {
            l=d;
        }
        int mid,place=0,a,b,val=x;
        while(l<=r){
            mid = (l+r)/2;
            cout<<"? "<<v[mid].size()<<" ";
            for(auto i: v[mid]){
                cout<<i<<" ";
            }
            cout<<endl;
            cin>>a>>b;
            cout.flush();
            if(b==y){
                place = mid;
                val=a;
                l=mid+1;
            }else {
                r=mid-1;
            }
        }
        d = y-place;
        if(d==0){
            cout<<"! "<<x<<" "<<place<<endl;
            cin>>str;
            cout.flush();
            continue;
        }
        s=val;
        while(s!=x){
            visit[s]=false;
            s = par[s];
        }
        cout<<"? "<<v[d].size()-1<<" ";
        for(auto i: v[d]){
            if(visit[i]==true){
                cout<<i<<" ";
            }

        }
        cout<<endl;
            cin>>a>>b;
            cout.flush();
        cout<<"! "<<a<<" "<<val<<endl;
        cin>>str;
        cout.flush();
    }
}

/*
1
10
1 2
1 5
2 3
2 4
3 9
4 8
4 10
5 6
6 7
*/