#include <bits/stdc++.h>
using namespace std;
const int MAX = 1010;
vector<vector<int>> G(MAX);
vector<vector<int>> dis(MAX, vector<int>(MAX, 0));
void bfs(int nd, int n) {
  vector<int> vis(n, 0);
  queue<int> q;
  q.push(nd);
  vis[nd] = 1;
  while (!q.empty()) {
    int cur = q.front();
    q.pop();
    for (int nxt : G[cur]) {
      if (!vis[nxt]) {
        dis[nd][nxt] = dis[nd][cur] + 1;
        vis[nxt] = 1;
        q.push(nxt);
      }
    }
  }
}
void make_dis(int n) {
  for (int i = 0; i < n; i++) {
    bfs(i, n);
  }
}
int sum, cdis;
int ln, rn;
vector<int> atloc(int nd, int n, int d, int other) {
  vector<int> res;
  for (int i = 0; i < n; i++) {
    if (dis[nd][i] == d && dis[other][i] == d + cdis) res.push_back(i);
  }
  return res;
}
bool ask(int n) {
  vector<int> a;
  if (!sum) {
    a = vector<int>(n);
    iota(a.begin(), a.end(), 0);
  } else {
    int goal = (sum - cdis + 1) / 2;
    if (ln == rn) {
      vector<int> Va = atloc(ln, n, goal, rn);
      a.insert(a.end(), Va.begin(), Va.end());
    } else {
      vector<int> Va = atloc(ln, n, goal, rn), Vb = atloc(rn, n, goal, ln);
      a.insert(a.end(), Va.begin(), Va.end());
      a.insert(a.end(), Vb.begin(), Vb.end());
    }
  }
  int sz = a.size();
  cout << "? " << sz << ' ';
  for (int i = 0; i < sz; i++) {
    cout << a[i] + 1 << ' ';
  }
  cout << endl;
  int nd, kiss;
  cin >> nd >> kiss;
  nd--;
  if (!sum) {
    ln = rn = nd;
    sum = kiss;
    cdis = 0;
  } else {
    int goal = (sum - cdis + 1) / 2;
    if (dis[ln][nd] == goal)
      ln = nd;
    else
      rn = nd;
    cdis += goal;
  }
  if (cdis == sum)
    return true;
  else
    return false;
}
void init() {
  sum = 0;
  for (int i = 0; i < MAX; i++) {
    G[i].clear();
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    init();
    int n;
    cin >> n;
    for (int i = 0; i < n - 1; i++) {
      int u, v;
      cin >> u >> v;
      u--, v--;
      G[u].push_back(v);
      G[v].push_back(u);
    }
    make_dis(n);
    while (!ask(n))
      ;
    cout << "! " << ln + 1 << ' ' << rn + 1 << endl;
    string ok;
    cin >> ok;
    if (ok != "Correct") return 0;
  }
  return 0;
}
