#include <bits/stdc++.h>
using namespace std;
vector<int> connections[1001];
vector<int> ask;
pair<int, int> que() {
  cout << "? " << ask.size();
  for (int x : ask) {
    cout << ' ' << x;
  }
  cout << endl;
  int u, v;
  cin >> u >> v;
  return {u, v};
}
int vis[10001];
int times = 0;
void dfs(int x, int d) {
  if (vis[x] == times) {
    return;
  }
  vis[x] = times;
  if (d == 0) {
    ask.push_back(x);
    return;
  }
  for (int c : connections[x]) {
    dfs(c, d - 1);
  }
  return;
}
int main() {
  int t;
  int n;
  cin >> t;
  while (t--) {
    cin >> n;
    ask.clear();
    for (int i = 1; i < n; i++) {
      int u, v;
      cin >> u >> v;
      connections[u].push_back(v);
      connections[v].push_back(u);
      ask.push_back(i);
    }
    ask.push_back(n);
    auto p = que();
    int root = p.first;
    int dist = p.second;
    int l = (dist + 1) / 2, r = dist;
    int ans = root;
    while (l <= r) {
      int m = (l + r) / 2;
      times++;
      ask.clear();
      dfs(root, m);
      if (ask.size() > 0) {
        auto pp = que();
        if (pp.second == dist) {
          l = m + 1;
          ans = pp.first;
        } else {
          r = m - 1;
        }
      } else {
        r = m - 1;
        continue;
      }
    }
    ask.clear();
    times++;
    dfs(ans, dist);
    auto ppp = que();
    int otherans = ppp.first;
    cout << "! " << ans << " " << otherans << endl;
    string cor;
    cin >> cor;
    for (int i = 1; i <= n; i++) {
      connections[i].clear();
    }
  }
}
