#include <bits/stdc++.h>
using namespace std;
const int maxN = 1100;
int used[maxN];
vector<int> g[maxN];
vector<int> query;
int n;
void dfs(int v, int p, int dep, int target) {
  if (used[v]) {
    return;
  }
  used[v] = 1;
  if (target == dep) {
    query.push_back(v);
    return;
  }
  for (int i = 0; i < g[v].size(); ++i) {
    int to = g[v][i];
    if (!used[to] && to != p) {
      dfs(to, v, dep + 1, target);
    }
  }
}
vector<int> findpath(int u, int v) {
  vector<int> used(n, -1);
  vector<int> p(n, -1);
  used[u] = 0;
  queue<int> q;
  q.push(u);
  while (!q.empty()) {
    int cur = q.front();
    q.pop();
    int dist = used[cur];
    for (int i = 0; i < g[cur].size(); ++i) {
      int to = g[cur][i];
      if (used[to] == -1) {
        used[to] = dist + 1;
        q.push(to);
        p[to] = cur;
      }
    }
  }
  vector<int> res;
  int curv = v;
  while (curv != u) {
    res.push_back(curv);
    curv = p[curv];
  }
  res.push_back(u);
  reverse(res.begin(), res.end());
  return res;
}
void solve() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    g[i].clear();
  }
  for (int i = 1; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    --x;
    --y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  int dist = -1;
  cout << "? " << n;
  for (int i = 0; i < n; ++i) {
    cout << " " << i + 1;
  }
  cout << endl;
  int u, v;
  cin >> u >> dist;
  --u;
  v = u;
  int curdist = 0;
  while (curdist < dist) {
    int target = (dist - curdist + 1) / 2;
    int pu, pv;
    vector<int> path = findpath(u, v);
    if (u == v) {
      pu = u, pv = u;
    } else {
      pu = path[1];
      pv = path[path.size() - 2];
    }
    query.clear();
    memset(used, 0, sizeof(used));
    dfs(u, pu, 0, target);
    auto qu = set<int>(query.begin(), query.end());
    if (u != v) {
      dfs(v, pv, 0, target);
    }
    cout << "? " << query.size();
    for (int i = 0; i < query.size(); ++i) {
      cout << " " << query[i] + 1;
    }
    cout << endl;
    int nx, ndist;
    cin >> nx >> ndist;
    --nx;
    if (qu.count(nx)) {
      u = nx;
    } else {
      v = nx;
    }
    curdist += target;
  }
  cout << "! " << u + 1 << " " << v + 1 << endl;
  string s;
  cin >> s;
}
int main() {
  int t;
  cin >> t;
  for (int tt = 0; tt < t; ++tt) {
    solve();
  }
  return 0;
}
