#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
vector<int> e[N];
pair<int, int> ask(vector<int>& vec) {
  cout << "? " << vec.size() << ' ';
  for (int x : vec) cout << x << ' ';
  cout << endl;
  int a, b;
  cin >> a >> b;
  if (a == -1) exit(0);
  return pair<int, int>(a, b);
}
int lev[N];
void dfs(int u, int p = -1, int l = 0) {
  lev[u] = l;
  for (int v : e[u]) {
    if (v == p) continue;
    dfs(v, u, l + 1);
  }
}
void _solve() {
  int n;
  cin >> n;
  vector<int> aux;
  for (int i = 1; i <= n; i++) {
    e[i].clear();
    aux.push_back(i);
  }
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  int rot, d;
  tie(rot, d) = ask(aux);
  dfs(rot);
  int l = 0, r = d;
  int w;
  while (l <= r) {
    int mid = (l + r) / 2;
    aux.clear();
    for (int i = 1; i <= n; ++i)
      if (lev[i] == mid) {
        aux.push_back(i);
      }
    int v, dist;
    if (aux.size() == 0) {
      dist = 0x3f3f3f3f;
    } else {
      tie(v, dist) = ask(aux);
      assert(dist >= d);
    }
    if (dist == d) {
      w = v;
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  dfs(w);
  pair<int, int> ans;
  ans.first = w;
  aux.clear();
  for (int i = 1; i <= n; i++) {
    if (lev[i] == d) aux.push_back(i);
  }
  ans.second = ask(aux).first;
  cout << "! " << ans.first << ' ' << ans.second << endl;
  string s;
  cin >> s;
  if (s == "Incorrect") {
    exit(0);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    _solve();
  }
}
