#include <bits/stdc++.h>
using namespace std;
pair<int, int> query(const vector<int>& nodes) {
  assert(!nodes.empty());
  cout << "? " << nodes.size() << " ";
  for (auto& u : nodes) cout << u << " ";
  cout << endl;
  fflush(stdout);
  int x, d;
  cin >> x >> d;
  if (x == -1 || d == -1) exit(0);
  return make_pair(x, d);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<vector<int> > adj(n + 1);
    for (int i = 0; i < n - 1; i++) {
      int u, v;
      cin >> u >> v;
      adj[u].push_back(v);
      adj[v].push_back(u);
    }
    vector<int> nodes(n);
    iota(nodes.begin(), nodes.end(), 1);
    int root, min_dist;
    tie(root, min_dist) = query(nodes);
    int max_depth = -1;
    vector<int> depth(n + 1);
    vector<vector<int> > nodes_at_depth(n + 1);
    function<void(int, int, int)> dfs = [&](int u, int p, int d) {
      depth[u] = d;
      nodes_at_depth[d].push_back(u);
      max_depth = max(max_depth, d);
      for (auto v : adj[u]) {
        if (v == p) continue;
        dfs(v, u, d + 1);
      }
    };
    dfs(root, -1, 0);
    int l = 1, r = max_depth, s = -1;
    while (l <= r) {
      int mid = l + r >> 1;
      int u, dist;
      tie(u, dist) = query(nodes_at_depth[mid]);
      if (dist == min_dist) {
        s = u;
        l = mid + 1;
      } else {
        r = mid - 1;
      }
    }
    assert(s != -1);
    for (int i = 0; i < nodes_at_depth.size(); i++) nodes_at_depth[i].clear();
    dfs(s, -1, 0);
    int f;
    tie(f, std::ignore) = query(nodes_at_depth[min_dist]);
    cout << "! " << s << " " << f << endl;
    fflush(stdout);
    string result;
    cin >> result;
    if (result == "Incorrect") exit(0);
  }
  return 0;
}
