#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
int n;
int t;
int L, R;
int h[maxn];
int cycsize;
int st[maxn];
int ft[maxn];
bool mark[maxn];
vector<int> bois;
vector<int> adj[maxn];
void in();
void solve();
void doyourthing();
void dofs(int u, int H);
void defs(int u, int H);
void dfs(int u);
void firstq();
void secondq();
void DFS(int u, int h);
void out();
int main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  int t = 1;
  cin >> t;
  bool b = 0;
  for (int i = 0; i < t; i++) {
    in();
    solve();
    out();
    for (int i = 0; i < n; i++) adj[i].clear();
  }
}
void in() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
}
void solve() {
  firstq();
  secondq();
  doyourthing();
}
void doyourthing() {
  t = 0;
  for (int i = 0; i < n; i++) mark[i] = 0;
  h[L] = 0;
  dfs(L);
  int now = cycsize - h[R];
  if (now) {
    bois.clear();
    defs(L, now);
    dofs(R, now);
    cout << "? " << bois.size() << ' ';
    for (auto i : bois) cout << i + 1 << ' ';
    cout << '\n';
    cout.flush();
    int Z;
    cin >> Z >> cycsize;
    Z--;
    if (st[R] <= st[Z] && st[Z] < ft[R])
      R = Z;
    else
      L = Z;
    doyourthing();
  }
}
void dofs(int u, int H) {
  if (h[u] - h[R] == (H + 1) / 2) {
    bois.push_back(u);
    return;
  }
  for (auto v : adj[u])
    if (h[v] == h[u] + 1) dofs(v, H);
}
void defs(int u, int H) {
  if (h[u] == (H + 1) / 2) {
    bois.push_back(u);
    return;
  }
  for (auto v : adj[u])
    if ((ft[R] <= st[v] || ft[v] <= st[R]) && h[v] == h[u] + 1) defs(v, H);
}
void dfs(int u) {
  mark[u] = 1;
  st[u] = t++;
  for (auto v : adj[u]) {
    if (!mark[v]) {
      h[v] = h[u] + 1;
      dfs(v);
    }
  }
  ft[u] = t;
}
void firstq() {
  cout << "? " << n << ' ';
  for (int i = 0; i < n; i++) cout << i + 1 << ' ';
  cout << '\n';
  cout.flush();
  cin >> L >> cycsize;
  L--;
}
void secondq() {
  bois.clear();
  for (int i = 0; i < n; i++) mark[i] = 0;
  DFS(L, 0);
  cout << "? " << bois.size() << ' ';
  for (auto i : bois) cout << i + 1 << ' ';
  cout << '\n';
  cout.flush();
  cin >> R >> cycsize;
  R--;
}
void DFS(int u, int h) {
  if (h == (cycsize + 1) / 2) {
    bois.push_back(u);
    return;
  }
  mark[u] = 1;
  for (auto v : adj[u])
    if (!mark[v]) DFS(v, h + 1);
}
void out() {
  cout << "! " << L + 1 << ' ' << R + 1 << '\n';
  cout.flush();
  string str;
  cin >> str;
}
