#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 11;
int n, ma;
int fa[N], dep[N];
vector<int> G[N], nd;
bool mark[N];
void dfs(int u, int f) {
  fa[u] = f;
  ma = max(ma, dep[u]);
  for (int v : G[u]) {
    if (v == f) continue;
    dep[v] = dep[u] + 1;
    dfs(v, u);
  }
}
pair<int, int> query() {
  if (!nd.size()) {
    cout << "ma=" << ma << endl;
  }
  cout << "? " << nd.size() << " ";
  for (int v : nd) {
    cout << v << " ";
  }
  cout << endl;
  int x, d;
  cin >> x >> d;
  if (x == -1 && d == -1) cout << x << " " << d << endl;
  assert(x != -1 && d != -1);
  nd.clear();
  return make_pair(x, d);
}
int A;
int main() {
  int T;
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> T;
  for (int t = 1; t <= T; t++) {
    cin >> n;
    int u, v;
    for (int i = 1; i <= n; i++) G[i].clear();
    for (int i = 1; i < n; i++) {
      cin >> u >> v;
      G[u].push_back(v);
      G[v].push_back(u);
    }
    for (int i = 1; i <= n; i++) {
      nd.push_back(i);
    }
    pair<int, int> now = query();
    dep[now.first] = 0;
    ma = 0;
    dfs(now.first, 0);
    int l = now.second - now.second / 2, r = min(now.second, ma), U = -1;
    while (l <= r) {
      int mid = l + r >> 1;
      for (int i = 1; i <= n; i++) {
        if (dep[i] == mid) nd.push_back(i);
      }
      pair<int, int> Res = query();
      if (Res.second == now.second)
        l = mid + 1, U = Res.first;
      else
        r = mid - 1;
    }
    int x = U;
    memset(mark, 0, sizeof mark);
    while (x > 0) {
      mark[x] = 1;
      x = fa[x];
    }
    int lef = now.second - dep[U];
    if (lef) {
      for (int i = 1; i <= n; i++) {
        if (mark[i]) continue;
        if (dep[i] == lef) nd.push_back(i);
      }
      if (!nd.size()) {
        int cnt = 0;
        int x = G[now.first].back();
        cout << "now.X=" << now.first << "t=" << t
             << "sz=" << G[now.first].size() << endl;
      }
      pair<int, int> res = query();
      cout << "! " << U << " " << res.first << endl;
    } else
      cout << "! " << U << " " << now.first << endl;
    static char s[111];
    cin >> s;
    if (s[0] == 'I') assert(0);
  }
  return 0;
}
