#include <bits/stdc++.h>
using namespace std;
const int N = 1020;
int tot;
int nex[N * 2], head[N], to[N * 2];
int dis[N][N];
void add(int x, int y) {
  nex[++tot] = head[x];
  head[x] = tot;
  to[tot] = y;
}
void dfs(int rt, int u, int pre, int dep) {
  dis[rt][u] = dep;
  for (int i = head[u]; i; i = nex[i]) {
    int v = to[i];
    if (v == pre) continue;
    dfs(rt, v, u, dep + 1);
  }
}
int point, dist;
void ask(int *s, int n) {
  printf("? %d ", n);
  for (int i = 1; i <= n; i++) printf("%d ", s[i]);
  printf("\n");
  fflush(stdout);
  scanf("%d%d", &point, &dist);
}
int s[N];
int main() {
  int T, n;
  scanf("%d", &T);
  while (T--) {
    memset(head, 0, sizeof(head));
    memset(dis, 0, sizeof(dis));
    tot = 0;
    scanf("%d", &n);
    for (int i = 1, x, y; i < n; i++)
      scanf("%d%d", &x, &y), add(x, y), add(y, x);
    for (int i = 1; i <= n; i++) dfs(i, i, 0, 0);
    memset(s, 0, sizeof(s));
    for (int i = 1; i <= n; i++) s[i] = i;
    ask(s, n);
    int root = point, D = dist;
    int l = (D + 1) / 2, r = D + 1, a1 = 0;
    int cnt = 0;
    while (l < r) {
      cnt = 0;
      int mid = l + r >> 1;
      for (int i = 1; i <= n; i++)
        if (dis[root][i] == mid) s[++cnt] = i;
      if (cnt == 0)
        r = mid;
      else {
        ask(s, cnt);
        if (D == dist)
          a1 = point, l = mid + 1;
        else
          r = mid;
      }
    }
    cnt = 0;
    for (int i = 1; i <= n; i++)
      if (dis[a1][i] == D) s[++cnt] = i;
    ask(s, cnt);
    printf("! %d %d\n", a1, point);
    fflush(stdout);
    char st[12];
    scanf("%s", &st);
  }
  return 0;
}
