#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > g;
void dfs(int v, int p, int d, vector<vector<int> >& a) {
  a[d].push_back(v);
  for (int u : g[v]) {
    if (u == p) continue;
    dfs(u, v, d + 1, a);
  }
}
void dfs2(int v, int p, int d, int need, vector<int>& q) {
  if (d == need) q.push_back(v);
  for (int u : g[v]) {
    if (u == p) continue;
    dfs2(u, v, d + 1, need, q);
  }
}
void solve() {
  int n;
  cin >> n;
  g.clear();
  g.resize(n + 1);
  for (int i = 0; i < n - 1; i++) {
    int f, t;
    cin >> f >> t;
    g[f].push_back(t);
    g[t].push_back(f);
  }
  cout << "? " << n;
  for (int i = 1; i <= n; i++) cout << " " << i;
  cout << endl;
  int each, optimal;
  cin >> each >> optimal;
  cout.flush();
  vector<vector<int> > a(1000);
  dfs(each, -1, 0, a);
  int f;
  int r = optimal + 1;
  int l = optimal / 2 - 1;
  if (l < 0) l = 0;
  while (r - l > 1) {
    int m = (l + r) / 2;
    if (a[m].size() == 0) {
      r = m;
      continue;
    }
    cout << "? " << a[m].size();
    for (int i = 0; i < a[m].size(); i++) cout << " " << a[m][i];
    cout << endl;
    int vertex;
    int dist;
    cin >> vertex >> dist;
    cout.flush();
    if (dist == optimal) {
      f = vertex;
      l = m;
    } else {
      r = m;
    }
  }
  vector<int> q;
  dfs2(f, -1, 0, optimal, q);
  cout << "? " << q.size();
  for (int i = 0; i < q.size(); i++) cout << " " << q[i];
  cout << endl;
  int second, opti2;
  cin >> second >> opti2;
  cout.flush();
  cout << "! " << f << " " << second << endl;
  cout.flush();
  string res;
  cin >> res;
  if (res == "Incorrect") exit(0);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
