#include <bits/stdc++.h>
using namespace std;
int i, j, k;
void solve(void);
int main() {
  int t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
int n, maxx;
vector<int> vis, node[1005], g[1005];
void preprocess() {
  for (i = (0); i <= (n); ++i) node[i].clear(), g[i].clear();
  vis.clear();
  vis.resize(n + 1, 0);
}
void dfs(int id, int d) {
  vis[id] = 1;
  maxx = ((maxx) > (d) ? (maxx) : (d));
  g[d].emplace_back(id);
  for (auto it : node[id])
    if (!vis[it]) dfs(it, d + 1);
}
void solve() {
  cin >> n;
  preprocess();
  for (i = (1); i <= (n - 1); ++i) {
    int x, y;
    cin >> x >> y;
    node[x].emplace_back(y);
    node[y].emplace_back(x);
  }
  int id, dis;
  maxx = 0;
  cout << "? " << n << " ";
  for (i = (1); i <= (n); ++i) cout << i << " ";
  cout << '\n';
  cin >> id >> dis;
  dfs(id, 0);
  int lo = dis / 2 + (dis % 2 > 0), hi = ((maxx) < (dis) ? (maxx) : (dis)), mid,
      ans = hi + 1;
  while (lo <= hi) {
    mid = (lo + hi) >> 1;
    cout << "? " << (int)g[mid].size() << " ";
    for (auto it : g[mid]) cout << it << " ";
    cout << '\n';
    int id, dist;
    cin >> id >> dist;
    if (dist == dis) {
      ans = id;
      lo = mid + 1;
    } else
      hi = mid - 1;
  }
  int x, y;
  x = ans;
  vis.clear();
  vis.resize(n + 1);
  for (i = (0); i <= (n); ++i) g[i].clear();
  dfs(x, 0);
  cout << "? " << (int)g[dis].size() << " ";
  for (auto it : g[dis]) cout << it << " ";
  cout << '\n';
  cin >> y >> dis;
  cout << "! " << x << " " << y << '\n';
  string s;
  cin >> s;
  return;
}
