#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int n, parent[N], dep[N], tin[N], tout[N], clk = 0;
int maxdep[N];
vector<int> g[N];
bool nemoj[N];
pair<int, int> pitaj(vector<int> v) {
  cout << "? " << v.size() << " ";
  for (auto f : v) cout << f << " ";
  cout << endl;
  int x, d;
  cin >> x >> d;
  if (x == -1) exit(0);
  return {x, d};
}
void kraj(int s, int f) {
  cout << "! " << s << " " << f << endl;
  string t;
  cin >> t;
  if (t == "Incorrect") exit(0);
}
void dfs(int x, int par) {
  parent[x] = par;
  tin[x] = clk++;
  maxdep[x] = dep[x];
  for (auto f : g[x]) {
    if (f == par) continue;
    dep[f] = dep[x] + 1;
    dfs(f, x);
    maxdep[x] = max(maxdep[x], maxdep[f]);
  }
  tout[x] = clk++;
}
bool ancestor(int x, int y) { return (tin[x] <= tin[y] && tout[x] >= tout[y]); }
void dfsp(int x, int par) {
  nemoj[x] = 1;
  for (auto f : g[x]) {
    if (f == par) continue;
    dfsp(f, x);
  }
}
void solve() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    g[i].clear();
    nemoj[i] = 0;
    tin[i] = tout[i] = 0;
    clk = 0;
    dep[i] = maxdep[i] = 0;
    parent[i] = 0;
  }
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  vector<int> v;
  for (int i = 1; i <= n; i++) v.push_back(i);
  auto sta = pitaj(v);
  int root = sta.first, dist = sta.second;
  dep[root] = 1;
  dfs(root, 0);
  v.clear();
  for (int i = 1; i <= n; i++) {
    if (i != root) v.push_back(i);
  }
  sta = pitaj(v);
  int prvi = sta.first, d1 = sta.second;
  assert(d1 == dist);
  if (g[root].size() == 1) {
    int nd = prvi;
    while (parent[nd] != root) {
      nd = parent[nd];
    }
    int depdrugog = 1 + dist;
    v.clear();
    for (int i = 1; i <= n; i++) {
      if (dep[i] == depdrugog) {
        v.push_back(i);
      }
    }
    sta = pitaj(v);
    kraj(root, sta.first);
    return;
  }
  int nd = prvi;
  while (parent[nd] != root) {
    nd = parent[nd];
  }
  v.clear();
  nemoj[root] = 1;
  dfsp(nd, root);
  for (int i = 1; i <= n; i++) {
    if (!nemoj[i]) v.push_back(i);
  }
  sta = pitaj(v);
  int drugi = sta.first, d2 = sta.second;
  if (d2 > dist) {
    int depdruge = 1 + dist;
    v.clear();
    for (int i = 1; i <= n; i++) {
      if (dep[i] == depdruge && ancestor(prvi, i)) {
        v.push_back(i);
      }
    }
    sta = pitaj(v);
    kraj(sta.first, root);
    return;
  }
  int l = dep[prvi], r = maxdep[prvi], ans = prvi;
  while (l <= r) {
    int mid = l + (r - l) / 2;
    v.clear();
    for (int i = 1; i <= n; i++) {
      if (dep[i] >= mid && ancestor(prvi, i)) {
        v.push_back(i);
      }
    }
    sta = pitaj(v);
    if (sta.second == dist) {
      ans = sta.first;
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  int depdruge = dist - (dep[ans] - 1) + 1;
  v.clear();
  for (int i = 1; i <= n; i++) {
    if (dep[i] == depdruge && ancestor(drugi, i)) {
      v.push_back(i);
    }
  }
  sta = pitaj(v);
  kraj(ans, sta.first);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
