#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int n;
vector<int> g[N], q;
int d[N][N];
void dfs(int root, int u, int p) {
  for (int v : g[u])
    if (v != p) {
      d[root][v] = d[root][u] + 1;
      dfs(root, v, u);
    }
}
pair<int, int> query() {
  printf("? %d", (int)q.size());
  for (int x : q) printf(" %d", x);
  putchar('\n');
  fflush(stdout);
  int x, y;
  scanf("%d%d", &x, &y);
  return {x, y};
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    for (int x, y, i = 1; i < n; ++i) {
      scanf("%d%d", &x, &y);
      g[x].push_back(y);
      g[y].push_back(x);
    }
    for (int i = 1; i <= n; ++i) dfs(i, i, i);
    q.clear();
    for (int i = 1; i <= n; ++i) q.push_back(i);
    auto [u, l] = query();
    int v = u;
    while (d[u][v] < l) {
      q.clear();
      for (int i = 1; i <= n; ++i)
        if (d[i][u] + d[i][v] != d[u][v] &&
            min(d[i][u], d[i][v]) >= (l - d[u][v] + 1) / 2)
          q.push_back(i);
      int x = query().first;
      if (d[x][u] < d[x][v])
        u = x;
      else
        v = x;
    }
    printf("! %d %d\n", u, v);
    fflush(stdout);
    scanf("%*s");
    for (int i = 1; i <= n; ++i) g[i].clear();
  }
  return 0;
}
