#include <bits/stdc++.h>
using namespace std;
const int maxn = 10005;
vector<int> e[maxn], a[maxn];
int deep[maxn], fa[maxn];
int n, root, ans, len;
inline pair<int, int> query(vector<int> &now) {
  cout << "? " << now.size();
  for (auto x : now) cout << " " << x;
  cout << endl;
  int x, y;
  cin >> x >> y;
  return {x, y};
}
inline void dfs(int u, int pre, int d) {
  fa[u] = pre;
  deep[u] = d;
  a[d].push_back(u);
  for (auto v : e[u]) {
    if (v == pre) continue;
    dfs(v, u, d + 1);
  }
}
inline bool check(int mid, int dis) {
  if (a[mid].empty()) return 0;
  auto [x, y] = query(a[mid]);
  if (y != dis) return 0;
  ans = x;
  return 1;
}
inline void init() {
  for (int i = 0; i < n + 5; ++i) e[i].clear(), a[i].clear();
  ans = -1;
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    cin >> n;
    for (int i = 0; i < n - 1; ++i) {
      int u, v;
      cin >> u >> v;
      e[u].push_back(v);
      e[v].push_back(u);
    }
    vector<int> noww(n);
    for (int i = 1; i <= n; ++i) noww[i - 1] = i;
    auto [rt, dis] = query(noww);
    dfs(rt, 0, 0);
    int l = (dis - 1) / 2 + 1, r = dis;
    while (l <= r) {
      int mid = l + r >> 1;
      if (check(mid, dis))
        l = mid + 1;
      else
        r = mid - 1;
    }
    int now = ans;
    while (1) {
      if (now == rt) break;
      int x = deep[now];
      a[x].erase(find(a[x].begin(), a[x].end(), now));
      now = fa[now];
    }
    int deepv = dis - deep[ans];
    int ans2 = query(a[deepv]).first;
    cout << "! " << ans << ' ' << ans2 << endl;
    string res;
    cin >> res;
    init();
  }
  return 0;
}
