#include <bits/stdc++.h>
using namespace std;
const int MX = 1000000;
const long long inf = 1e9;
const long long mod = 998244353;
vector<int> g[MX], lvl[MX], v;
int len[MX];
int mxlvl = 0;
void dfs(int x, int lv, int p) {
  len[x] = 0;
  for (auto u : g[x]) {
    if (u == p) continue;
    dfs(u, lv + 1, x);
    len[x] = max(len[x], 1 + len[u]);
  }
}
void dfs3(int x, int lv, int p, int id) {
  lvl[lv].push_back(x);
  mxlvl = max(mxlvl, lv);
  for (auto u : g[x]) {
    if (u == p || u == id) continue;
    dfs3(u, lv + 1, x, id);
  }
}
void dfs2(int x, int d, int p) {
  if (!d) {
    v.push_back(x);
    return;
  }
  for (auto u : g[x]) {
    if (u == p) continue;
    dfs2(u, d - 1, x);
  }
}
pair<int, int> ask(int m) {
  cout << "? " << lvl[m].size();
  for (auto u : lvl[m]) cout << ' ' << u;
  cout << endl;
  int x, d;
  cin >> x >> d;
  return {x, d};
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, tc;
  cin >> tc;
  while (tc--) {
    cin >> n;
    for (int i = 1; i < n; i++) {
      int x, y;
      cin >> x >> y;
      g[x].push_back(y), g[y].push_back(x);
    }
    cout << "? " << n;
    for (int i = 1; i <= n; i++) cout << ' ' << i;
    cout << endl;
    int x, d;
    cin >> x >> d;
    dfs(x, 0, 0);
    int mx = 0, id = 0;
    for (auto u : g[x]) {
      if (len[u] > mx) mx = len[u], id = u;
    }
    dfs3(x, 0, 0, id);
    int lo = 0, hi = mxlvl, rs = 0;
    while (lo <= hi) {
      m = (lo + hi) / 2;
      pair<int, int> xx = ask(m);
      if (xx.second == d)
        rs = xx.first, lo = m + 1;
      else
        hi = m - 1;
    }
    dfs2(rs, d, 0);
    cout << "? " << v.size();
    for (auto u : v) cout << ' ' << u;
    cout << endl;
    cin >> x >> d;
    cout << "! " << x << ' ' << rs << endl;
    string s;
    cin >> s;
    for (int i = 0; i <= n; len[i] = 0, i++) lvl[i].clear(), g[i].clear();
    v.clear();
    mxlvl = 0;
  }
  return 0;
}
