#include <bits/stdc++.h>
using namespace std;
long long in() {
  long long a;
  scanf("%lld", &a);
  return a;
}
double din() {
  double a;
  scanf("%lf", &a);
  return a;
}
long long bigmod(long long b, long long p, long long md) {
  if (p == 0) return 1;
  if (p % 2 == 1) {
    return ((b % md) * bigmod(b, p - 1, md)) % md;
  } else {
    long long y = bigmod(b, p / 2, md);
    return (y * y) % md;
  }
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long getRandom(long long a, long long b) {
  long long ret = (long long)rand() * (long long)rand();
  ret %= (b - a + 1);
  ret += a;
  return ret;
}
vector<int> adj[1005];
int vis[1005], diss[1005], par[1005], mx;
void dfs(int u) {
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (vis[v] == 0) {
      diss[v] = 1 + diss[u];
      mx = max(mx, diss[v]);
      vis[v] = 1;
      vis[u] = 1;
      dfs(v);
    }
  }
}
void solve1(int n, int a, int dis) {
  vector<int> v;
  dfs(a);
  for (int i = 1; i <= n; i++) {
    if (diss[i] == dis) v.push_back(i);
  }
  printf("? %d", v.size());
  for (int i = 0; i < v.size(); i++) printf(" %d", v[i]);
  puts("");
  fflush(stdout);
  int b = in(), bla = in();
  printf("! %d %d\n", a, b);
  puts("");
  fflush(stdout);
}
void solve2(int n, int a, int b, int c, int dis) {
  diss[b] = 1;
  vis[a] = 1;
  mx = 1;
  dfs(b);
  int lo = 1, hi = mx, mid, ok;
  vector<int> v;
  while (hi >= lo) {
    mid = hi + lo >> 1;
    for (int i = 1; i <= n; i++)
      if (diss[i] == mid) v.push_back(i);
    printf("? %d", v.size());
    for (int i = 0; i < v.size(); i++) printf(" %d", v[i]);
    puts("");
    fflush(stdout);
    int x = in(), dd = in();
    if (dd == dis) {
      lo = mid + 1;
      ok = x;
    } else
      hi = mid - 1;
    v.clear();
  }
  dis -= diss[ok];
  memset(diss, 0, sizeof diss);
  diss[c] = 1;
  dfs(c);
  for (int i = 1; i <= n; i++) {
    if (diss[i] == dis) v.push_back(i);
  }
  printf("? %d", v.size());
  for (int i = 0; i < v.size(); i++) printf(" %d", v[i]);
  puts("");
  fflush(stdout);
  int okk = in(), maa = in();
  printf("! %d %d\n", ok, okk);
  fflush(stdout);
}
int main() {
  int t = in();
  while (t--) {
    int n = in();
    for (int i = 0; i <= n; i++)
      adj[i].clear(), vis[i] = 0, diss[i] = 0, par[i] = 0;
    char s[100];
    for (int i = 0; i < n - 1; i++) {
      int u = in(), v = in();
      adj[u].push_back(v);
      adj[v].push_back(u);
    }
    if (n == 2) {
      printf("! 1 2\n");
      fflush(stdout);
      scanf("%s", s);
      continue;
    }
    printf("? %d", n);
    for (int i = 1; i <= n; i++) printf(" %d", i);
    puts("");
    fflush(stdout);
    int a = in(), sum = in();
    if (adj[a].size() == 1) {
      solve1(n, a, sum);
      scanf("%s", s);
      continue;
    }
    printf("? %d", adj[a].size());
    for (int i = 0; i < adj[a].size(); i++) printf(" %d", adj[a][i]);
    puts("");
    fflush(stdout);
    int b = in(), d = in();
    if (sum == 1) {
      printf("! %d %d\n", a, b);
      fflush(stdout);
      scanf("%s", s);
      continue;
    }
    printf("? %d", adj[a].size() - 1);
    for (int i = 0; i < adj[a].size(); i++) {
      if (adj[a][i] == b) continue;
      printf(" %d", adj[a][i]);
    }
    puts("");
    fflush(stdout);
    int c = in(), dd = in();
    if (dd > sum) {
      solve1(n, a, sum);
    } else {
      solve2(n, a, b, c, sum);
    }
    scanf("%s", s);
  }
}
