#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int next, to;
} edge[2005];
int head[1005], cnt, n, D, fa[1005];
vector<int> dep[1005];
inline void add(int x, int y) {
  edge[cnt].next = head[x], edge[cnt].to = y, head[x] = cnt++;
}
inline vector<int> query(vector<int> w) {
  if (w.empty()) {
    vector<int> s;
    s.push_back(-1);
    return s;
  }
  printf("? %d", w.size());
  for (int i : w) printf(" %d", i);
  printf("\n");
  fflush(stdout);
  int a, b;
  vector<int> ans;
  scanf("%d%d", &a, &b);
  ans.push_back(a), ans.push_back(b);
  return ans;
}
void DFS0(int x, int f) {
  fa[x] = f;
  for (int i = head[x]; i; i = edge[i].next) {
    if (edge[i].to == f) continue;
    DFS0(edge[i].to, x);
  }
}
void DFS(int x, int f, int d) {
  dep[d].push_back(x);
  for (int i = head[x]; i; i = edge[i].next) {
    if (edge[i].to == f) continue;
    DFS(edge[i].to, x, d + 1);
  }
}
inline int solve(int x) {
  int now = x;
  for (int j = 0; j <= 1000; j++) dep[j].clear();
  DFS(x, 0, 0);
  vector<int> tmp;
  for (int i = 9; i >= 0; i--) {
    tmp = query(dep[1 << i]);
    if (tmp[0] != -1 && tmp[1] == D) {
      for (int j = 0; j <= 1000; j++) dep[j].clear();
      DFS(now = tmp[0], fa[tmp[0]], 0);
    }
  }
  return now;
}
char opt[15];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    for (int i = 1; i <= 1000; i++) head[i] = 0;
    cnt = 1;
    for (int i = 1, x, y; i < n; i++)
      scanf("%d%d", &x, &y), add(x, y), add(y, x);
    vector<int> tmp;
    for (int i = 1; i <= n; i++) tmp.push_back(i);
    tmp = query(tmp), D = tmp[1], DFS0(tmp[0], 0);
    int a = solve(tmp[0]);
    for (int j = 0; j <= 1000; j++) dep[j].clear();
    DFS(a, 0, 0);
    tmp = query(dep[D]);
    printf("! %d %d\n", a, tmp[0]);
    fflush(stdout);
    scanf("%s", opt);
    if (opt[0] == 'I') return 0;
  }
  return 0;
}
