#include <bits/stdc++.h>
using namespace std;
void read(int &x) {
  char ch = getchar();
  x = 0;
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
}
const int N = 1024;
int n, p, len, _p, _len, a, b;
char ch[10];
vector<int> to[N], t[N];
void dfs(int u, int la, int d) {
  t[d].push_back(u);
  for (int i = 0; i < to[u].size(); ++i)
    if (to[u][i] != la) dfs(to[u][i], u, d + 1);
}
void query(int d) {
  printf("? %d", t[d].size());
  for (int i = 0; i < t[d].size(); ++i) printf(" %d", t[d][i]);
  puts("");
  fflush(stdout);
  cin >> _p >> _len;
}
signed main() {
  int T;
  cin >> T;
  int la;
  while (T--) {
    cin >> n;
    for (int i = 0; i <= n; ++i) to[i].clear(), t[i].clear();
    for (int i = 1, u, v; i < n; ++i)
      cin >> u >> v, to[u].push_back(v), to[v].push_back(u);
    printf("? %d", n);
    for (int i = 1; i <= n; ++i) printf(" %d", i);
    puts("");
    fflush(stdout);
    cin >> p >> len;
    dfs(p, p, 0);
    int l = 0, r = len;
    while (!t[r].size()) --r;
    while (l <= r) {
      int mid(l + r >> 1);
      query(mid);
      if (_len == len) {
        a = _p;
        l = mid + 1;
      } else
        r = mid - 1;
    }
    for (int i = 0; i <= n; ++i) t[i].clear();
    dfs(a, a, 0);
    printf("? %d", t[len].size());
    for (int i = 0; i < t[len].size(); ++i) printf(" %d", t[len][i]);
    puts("");
    fflush(stdout);
    cin >> b >> _len;
    printf("! %d %d\n", a, b);
    fflush(stdout);
    cin >> ch;
  }
  return 0;
}
