#include <bits/stdc++.h>
using namespace std;
class TaskF {
  int n;
  vector<int> depth;
  vector<vector<int>> adj, NodeAtDepth;
  void dfs(int node, int distance) {
    depth[node] = distance;
    NodeAtDepth[distance].emplace_back(node);
    for (int &nnode : adj[node]) {
      if (depth[nnode] == -1) {
        dfs(nnode, distance + 1);
      }
    }
  }
  pair<int, int> query(const vector<int> &nodes) {
    cout << "? " << nodes.size();
    for (auto &node : nodes) cout << ' ' << node + 1;
    cout << '\n' << flush;
    int node, distance;
    cin >> node >> distance;
    node--;
    return make_pair(node, distance);
  }

 public:
  TaskF(int n) {
    this->n = n;
    adj.resize(n);
    depth.assign(n, -1);
    NodeAtDepth.resize(n);
    for (int i = 1; i < n; i++) {
      int u, v;
      cin >> u >> v;
      u--, v--;
      adj[u].emplace_back(v);
      adj[v].emplace_back(u);
    }
  }
  void solve() {
    vector<int> nodes(n);
    iota(nodes.begin(), nodes.end(), 0);
    int root, distance;
    tie(root, distance) = query(nodes);
    dfs(root, 0);
    int max_depth = *max_element(depth.begin(), depth.end());
    int lo = (distance + 1) / 2, hi = min(distance, max_depth),
        HiddenNodeI = -1;
    while (lo <= hi) {
      int md = (lo + hi) / 2;
      int node, cur_distance;
      tie(node, cur_distance) = query(NodeAtDepth[md]);
      if (cur_distance == distance) {
        HiddenNodeI = node;
        lo = md + 1;
      } else {
        hi = md - 1;
      }
    }
    for (int i = 0; i < n; i++) {
      NodeAtDepth[i].clear();
    }
    fill(depth.begin(), depth.end(), -1);
    dfs(HiddenNodeI, 0);
    int HiddenNodeII;
    tie(HiddenNodeII, ignore) = query(NodeAtDepth[distance]);
    cout << "! " << HiddenNodeI + 1 << ' ' << HiddenNodeII + 1 << '\n' << flush;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    TaskF F(n);
    F.solve();
    string res;
    cin >> res;
  }
}
