#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int mx;
vector<int> adj[N], depth[N], lol;
void dfs(int node, int pr, int h) {
  mx = max(mx, h);
  depth[h].push_back(node);
  for (auto &v : adj[node])
    if (v != pr) dfs(v, node, h + 1);
}
void dfs2(int node, int pr, int req) {
  if (req == 0) lol.push_back(node);
  for (auto &v : adj[node])
    if (v != pr) dfs2(v, node, req - 1);
}
void solve() {
  int n;
  cin >> n;
  mx = 0;
  for (int i = 1; i <= n; i++) adj[i].clear();
  for (int i = 1, u, v; i <= n - 1; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  cout << "? " << n;
  for (int i = 1; i <= n; i++) cout << " " << i;
  cout << endl;
  int root, d;
  cin >> root >> d;
  cout << "? " << adj[root].size();
  for (auto &v : adj[root]) cout << " " << v;
  cout << endl;
  int req;
  cin >> req >> d;
  dfs(req, root, 1);
  int s = 1, e = mx, ans, tmp_d, tmp_x;
  while (s <= e) {
    int mid = (s + e) >> 1;
    cout << "? " << depth[mid].size();
    for (auto &ele : depth[mid]) cout << " " << ele;
    cout << endl;
    cin >> tmp_x >> tmp_d;
    if (tmp_d > d)
      e = mid - 1;
    else
      s = mid + 1, ans = tmp_x;
  }
  lol.clear();
  dfs2(ans, ans, d);
  cout << "? " << lol.size();
  for (auto &ele : lol) cout << " " << ele;
  cout << endl;
  int haha;
  cin >> haha >> d;
  cout << "! " << haha << " " << ans << endl;
  for (int i = 1; i <= mx; i++) depth[i].clear();
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
    string s;
    cin >> s;
  }
}
