#include <bits/stdc++.h>
using namespace std;
int resNode, resDist;
vector<int> a;
void query() {
  cout << "?" << ' ' << a.size();
  for (int i : a) cout << ' ' << i;
  cout << endl;
  a.clear();
  cin >> resNode >> resDist;
}
signed main() {
  cin.tie(0)->sync_with_stdio(0);
  int T;
  cin >> T;
  while (T--) {
    int n, x, y;
    cin >> n;
    vector<int> g[n + 1], d(n + 1, -1);
    for (int i = 1; i < n; ++i) {
      cin >> x >> y;
      g[x].push_back(y);
      g[y].push_back(x);
    }
    queue<int> q;
    q.push(d[1] = 1);
    while (!q.empty()) {
      int u = q.front();
      q.pop();
      for (int v : g[u])
        if (d[v] < 0) d[v] = d[u] + 1, q.push(v);
    }
    for (int i = 1; i <= n; ++i) a.push_back(i);
    query();
    int dist = resDist, farthest = *max_element(d.begin() + 1, d.end());
    int low = 1, high = farthest;
    while (low < high) {
      int mid = (low + high) / 2;
      for (int i = 1; i <= n; ++i)
        if (d[i] > mid) a.push_back(i);
      query();
      if (resDist == dist)
        low = mid + 1;
      else
        high = mid;
    }
    for (int i = 1; i <= n; ++i)
      if (d[i] == low) a.push_back(i);
    query();
    int ans = resNode;
    d.assign(n + 1, -1);
    d[ans] = 0;
    q.push(ans);
    while (!q.empty()) {
      int u = q.front();
      q.pop();
      for (int v : g[u])
        if (d[v] < 0) d[v] = d[u] + 1, q.push(v);
    }
    for (int i = 1; i <= n; ++i)
      if (d[i] == dist) a.push_back(i);
    query();
    cout << "!" << ' ' << ans << ' ' << resNode << endl;
    string s;
    cin >> s;
  }
}
