#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 1;
vector<int> g[N];
bool u[N];
int pr[N];
void dfs(int v) {
  for (auto to : g[v]) {
    if (to == pr[v]) continue;
    pr[to] = v;
    dfs(to);
  }
}
int dist;
vector<int> arr;
void add(int v, int lvl = 0) {
  if (lvl == dist) {
    arr.push_back(v);
    return;
  }
  for (auto to : g[v]) {
    if (to == pr[v] || u[to]) continue;
    add(to, lvl + 1);
  }
}
int n;
void vanish() {
  for (int i = 1; i <= n; ++i) {
    pr[i] = 0;
    u[i] = 0;
    g[i].clear();
  }
}
int t;
void solve() {
  vanish();
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  cout << "? " << n << endl;
  for (int i = 1; i <= n; ++i) cout << i << " ";
  cout << endl;
  int s, sum;
  cin >> s >> sum;
  dfs(s);
  int f = s;
  u[s] = 1;
  while (sum) {
    dist = (sum + 1) >> 1;
    arr.clear();
    add(s);
    if (s != f) add(f);
    cout << "? " << int(arr.size());
    for (auto to : arr) cout << " " << to;
    cout << endl;
    int v, bla;
    cin >> v >> bla;
    sum -= dist;
    int temp = v;
    while (v != s && v != f) {
      u[v] = 1;
      v = pr[v];
    }
    if (v == s)
      s = temp;
    else
      f = temp;
  }
  cout << "! " << s << " " << f << endl;
  string e;
  cin >> e;
}
int main() {
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
