#include <bits/stdc++.h>
using namespace std;
const int maxm = 1e3 + 5;
vector<int> g[maxm];
vector<int> d[maxm];
vector<int> temp;
int maxdep;
int n;
void dfs1(int x, int fa, int dep) {
  maxdep = max(maxdep, dep);
  d[dep].push_back(x);
  for (int v : g[x]) {
    if (v == fa) continue;
    dfs1(v, x, dep + 1);
  }
}
void dfs2(int x, int fa, int dis) {
  if (dis < 0) return;
  if (dis == 0) {
    temp.push_back(x);
    return;
  }
  for (int v : g[x]) {
    if (v == fa) continue;
    dfs2(v, x, dis - 1);
  }
}
signed main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      g[i].clear();
    }
    for (int i = 1; i < n; i++) {
      int a, b;
      scanf("%d%d", &a, &b);
      g[a].push_back(b);
      g[b].push_back(a);
    }
    printf("? %d", n);
    for (int i = 1; i <= n; i++) printf(" %d", i);
    printf("\n");
    fflush(stdout);
    for (int i = 0; i < n; i++) {
      d[i].clear();
    }
    maxdep = 0;
    int rt, dis;
    scanf("%d%d", &rt, &dis);
    dfs1(rt, rt, 0);
    int l = 1, r = min(dis, maxdep);
    int ans1 = -1;
    while (l <= r) {
      int mid = (l + r) / 2;
      printf("? %d", d[mid].size());
      for (int v : d[mid]) {
        printf(" %d", v);
      }
      printf("\n");
      fflush(stdout);
      int x, dis1;
      scanf("%d%d", &x, &dis1);
      if (dis1 == dis) {
        ans1 = x, l = mid + 1;
      } else {
        r = mid - 1;
      }
    }
    temp.clear();
    dfs2(ans1, ans1, dis);
    printf("? %d", temp.size());
    for (int v : temp) {
      printf(" %d", v);
    }
    printf("\n");
    fflush(stdout);
    int ans2, dis1;
    scanf("%d%d", &ans2, &dis1);
    printf("! %d %d\n", ans1, ans2);
    fflush(stdout);
    char s[100];
    scanf("%s", s);
  }
  return 0;
}
