#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 1000 + 10;
int n, maxLevel;
vector<int> edge[maxn];
vector<int> gu;
int dis[maxn];
vector<int> level[maxn];
int fa[maxn];
bool used[maxn];
void print(int a[], int n, int st = 0) {
  for (int i = 0; i < n; i++) {
    if (i != 0) printf(" ");
    printf("%d", a[i + st]);
  }
  printf("\n");
}
void init() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) edge[i].clear();
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    edge[x].push_back(y);
    edge[y].push_back(x);
  }
}
void guess(vector<int> a, int &u, int &value) {
  printf("? %d", int(a.size()));
  for (int i = 0; i < a.size(); i++) printf(" %d", a[i]);
  printf("\n");
  fflush(stdout);
  scanf("%d%d", &u, &value);
}
void answer(int u1, int u2) {
  char s[20];
  printf("! %d %d\n", u1, u2);
  fflush(stdout);
  scanf("%s", s);
}
void dfs(int u) {
  for (int i = 0; i < edge[u].size(); i++) {
    int v = edge[u][i];
    if (dis[v] == -1) {
      dis[v] = dis[u] + 1;
      fa[v] = u;
      maxLevel = max(maxLevel, dis[v]);
      level[dis[v]].push_back(v);
      dfs(v);
    }
  }
}
void doit() {
  int r, len, k1, k2;
  gu.clear();
  for (int i = 1; i <= n; i++) gu.push_back(i);
  guess(gu, r, len);
  for (int i = 0; i <= n; i++) level[i].clear();
  for (int i = 0; i <= n; i++) dis[i] = -1;
  dis[r] = 0;
  level[0].push_back(r);
  maxLevel = 0;
  dfs(r);
  int left = (len + 1) / 2, right = min(len, maxLevel), mid, ans, u, d;
  while (left <= right) {
    mid = (left + right) >> 1;
    guess(level[mid], u, d);
    if (d <= len) {
      ans = mid;
      k1 = u;
      left = mid + 1;
    } else {
      right = mid - 1;
    }
  }
  if (ans == len) {
    answer(r, k1);
    return;
  }
  u = k1;
  for (int i = 1; i <= n; i++) used[i] = false;
  while (u != r) {
    used[u] = true;
    u = fa[u];
  }
  gu.clear();
  for (int i = 0; i < level[len - ans].size(); i++) {
    if (!used[level[len - ans][i]]) {
      gu.push_back(level[len - ans][i]);
    }
  }
  guess(gu, k2, d);
  answer(k1, k2);
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    init();
    doit();
  }
  return 0;
}
