#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
const long long inf = 1e18;
long long i, j, k, n, m, x, y, ma = -inf, mi = inf, qq = 1, w, fr, to, t;
char ch;
long long sz, root;
vector<vector<long long> > g, rd;
vector<long long> d;
set<long long> st, dd;
string correct;
void dfs(long long second, long long p) {
  if (second != root)
    d[second] = d[p] + 1;
  else
    d[second] = 0;
  for (auto v : g[second])
    if (v != p) dfs(v, second);
}
void binsearch(long long l, long long r) {
  if (l > r) return;
  long long cur = (l + r) / 2;
  cout << "? " << rd[cur].size() << ' ';
  for (auto v : rd[cur]) cout << v + 1 << ' ';
  cout << endl;
  cin >> x >> t;
  x--;
  if (t == m) {
    ma = max(ma, d[x]);
    st.insert(x);
  }
  if (l == r) return;
  if (t == m)
    binsearch(cur + 1, r);
  else if (cur != l)
    binsearch(l, cur - 1);
}
void bfs(long long second) {
  vector<bool> u(n, false);
  vector<long long> di(n, 0);
  queue<long long> q;
  q.push(second);
  u[second] = true;
  while (!q.empty()) {
    long long x = q.front();
    q.pop();
    for (auto v : g[x]) {
      if (!u[v]) {
        u[v] = true;
        di[v] = di[x] + 1;
        q.push(v);
      }
    }
  }
  for (i = 0; i < n; i++) {
    if (di[i] == m) {
      dd.insert(i);
    }
  }
}
void solve() {
  cin >> n;
  g.assign(n, vector<long long>(0));
  d.resize(n);
  st.clear();
  for (i = 0; i < n - 1; i++) {
    cin >> fr >> to;
    fr--;
    to--;
    g[fr].push_back(to);
    g[to].push_back(fr);
  }
  cout << "? " << n << ' ';
  for (i = 0; i < n; i++) cout << i + 1 << ' ';
  cout << endl;
  cin >> x >> m;
  x--;
  st.insert(x);
  root = x;
  dfs(root, root);
  long long depth = d[root];
  sz = *max_element(d.begin(), d.end());
  rd.assign(sz + 1, vector<long long>(0));
  for (i = 0; i < n; i++) {
    rd[d[i]].push_back(i);
  }
  ma = depth;
  binsearch((m + 1) / 2, min(m, sz));
  long long curv = -1;
  for (auto v : st)
    if (d[v] == ma) curv = v;
  dd.clear();
  bfs(curv);
  cout << "? " << dd.size() << ' ';
  for (auto v : dd) cout << v + 1 << ' ';
  cout << endl;
  cin >> x >> t;
  x--;
  cout << "! " << curv + 1 << ' ' << x + 1 << endl;
  cin >> correct;
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> qq;
  while (qq--) {
    solve();
  }
}
