#include <bits/stdc++.h>
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 = 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;
}
