#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > graph, level;
vector<int> par;
pair<int, int> ask(const vector<int>& num) {
  cout << "? ";
  cout << (int)num.size() << " ";
  for (auto el : num) cout << el + 1 << " ";
  cout << endl;
  int x, d;
  cin >> x >> d;
  x--;
  return {x, d};
}
void dfs(int v, int p, int d) {
  level[d].push_back(v);
  par[v] = p;
  for (int to : graph[v]) {
    if (to != p) dfs(to, v, d + 1);
  }
}
void solve() {
  graph.clear();
  level.clear();
  par.clear();
  int n;
  cin >> n;
  graph.resize(n);
  level.resize(n);
  par.resize(n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  vector<int> num;
  for (int i = 0; i < n; i++) num.push_back(i);
  auto smth = ask(num);
  int root = smth.first, len = smth.second;
  dfs(root, -1, 0);
  int l = 0, r = -1;
  for (int i = 0; i < n; i++) {
    if (!level[i].empty()) r = i;
  }
  r++;
  int v = -1, u;
  while (r - l > 1) {
    int m = (r + l) >> 1;
    auto kek = ask(level[m]);
    if (kek.second == len) {
      l = m;
      v = kek.first;
    } else
      r = m;
  }
  if (v == -1) v = level[0][0];
  int depth_u = len - l;
  int f = v, now = l;
  while (now > depth_u) {
    now--;
    f = par[f];
  }
  vector<int> lol;
  for (auto el : level[depth_u]) {
    if (el != v && el != f) lol.push_back(el);
  }
  if (lol.empty()) {
    cout << "! " << v + 1 << " " << f + 1 << endl;
    return;
  }
  auto kek = ask(lol);
  u = kek.first;
  cout << "! " << v + 1 << " " << u + 1 << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    solve();
    string res;
    cin >> res;
    if (res[0] == 'I') exit(0);
  }
  return 0;
}
