#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
const int maxn5 = 5e5 + 10;
const int maxnt = 1.2e6 + 10;
const int maxn3 = 1e3 + 10;
const long long mod = 1e9 + 7;
const long long inf = 2e18;
int r, n, h[maxn5], mx[maxn5], imp, ver;
vector<int> adj[maxn5], av[maxn5], q;
bool mark[maxn5];
void dfs(int v) {
  mark[v] = true;
  mx[v] = h[v];
  for (auto u : adj[v])
    if (!mark[u]) {
      h[u] = h[v] + 1;
      dfs(u);
      mx[v] = max(mx[v], mx[u]);
    }
  mark[v] = false;
  return;
}
void get_node(int v) {
  mark[v] = true;
  int cnt = 0;
  av[h[v]].push_back(v);
  for (auto u : adj[v])
    if (!mark[u]) {
      if (cnt == 0 and v == r and mx[u] == mx[v])
        cnt++;
      else
        get_node(u);
    }
  mark[v] = false;
  return;
}
pair<int, int> ask() {
  if (q.empty()) return {0, maxn};
  cout << "? " << q.size() << ' ';
  for (auto u : q) cout << u << ' ';
  cout << endl;
  int a, b;
  cin >> a >> b;
  return {a, b};
}
bool check(int mid) {
  q.clear();
  for (auto u : av[mid]) q.push_back(u);
  pair<int, int> a = ask();
  if (a.second > imp) return false;
  ver = a.first;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tt;
  cin >> tt;
  while (tt--) {
    cin >> n;
    q.clear();
    for (int i = 1; i <= n; i++) {
      adj[i].clear();
      q.push_back(i);
      mark[i] = false;
      av[i].clear();
    }
    for (int i = 0; i < n - 1; i++) {
      int a, b;
      cin >> a >> b;
      adj[a].push_back(b);
      adj[b].push_back(a);
    }
    pair<int, int> a = ask();
    r = a.first;
    imp = a.second;
    h[r] = 0;
    dfs(a.first);
    get_node(a.first);
    ver = a.first;
    int lo = 0, hi = n / 2 + 1;
    while (hi - lo > 1) {
      int mid = (lo + hi) >> 1;
      if (check(mid))
        lo = mid;
      else
        hi = mid;
    }
    h[ver] = 0;
    dfs(ver);
    q.clear();
    for (int i = 1; i <= n; i++)
      if (h[i] == imp) q.push_back(i);
    a = ask();
    cout << "! " << ver << ' ' << a.first << endl;
    string re;
    cin >> re;
    if (re != "Correct") exit(0);
  }
  return 0;
}
