#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long mod = 1000000007;
const long long linf = 0x3f3f3f3f3f3f3f3f;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
vector<int> g[1010];
int nivel[1010];
int max_nivel[1010];
int root, sum;
int node1, node2;
void dfs(int x, int u = 1) {
  nivel[x] = u;
  max_nivel[x] = u;
  for (auto v : g[x]) {
    if (!nivel[v]) {
      dfs(v, u + 1);
      max_nivel[x] = max(max_nivel[x], max_nivel[v]);
    }
  }
}
pair<int, int> query(vector<int> v) {
  cout << "? " << v.size() << " ";
  for (auto p : v) cout << p << " ";
  cout << endl;
  pair<int, int> a;
  cin >> a.first >> a.second;
  return a;
}
void solve() {
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 1; i <= n; i++) v.push_back(i);
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  pair<int, int> aux = query(v);
  root = aux.first, sum = aux.second;
  node1 = aux.first;
  dfs(root);
  int ini = 0, fim = (n + 1) / 2;
  for (int i = 1; i <= n; i++) {
    nivel[i]--;
    max_nivel[i]--;
  }
  while (ini <= fim) {
    v.clear();
    int meio = (ini + fim) / 2;
    for (int i = 1; i <= n; i++) {
      if (nivel[i] == meio && max_nivel[i] <= (n + 1) / 2) v.push_back(i);
    }
    if (meio == 0 && max_nivel[root] > (n + 1) / 2) v.push_back(root);
    if (v.empty()) {
      fim = meio - 1;
      continue;
    }
    pair<int, int> aux = query(v);
    if (aux.second != sum)
      fim = meio - 1;
    else
      ini = meio + 1, node1 = aux.first;
  }
  vector<int> lq;
  for (int i = 1; i <= n; i++) nivel[i] = 0;
  dfs(node1);
  for (int i = 1; i <= n; i++) {
    nivel[i]--;
    if (i == node1) continue;
    if (nivel[i] == sum) lq.push_back(i);
  }
  aux = query(lq);
  node2 = aux.first;
  cout << "! " << node1 << " " << node2 << endl;
  lq.clear();
  for (int i = 1; i <= n; i++) g[i].clear(), max_nivel[i] = 0, nivel[i] = 0;
  string A;
  cin >> A;
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  ;
  int t_;
  cin >> t_;
  while (t_--) solve();
  return 0;
}
