#include <bits/stdc++.h>
using namespace std;
vector<int> g[1005];
int parent[1005];
int h[1005], F[1005];
vector<int> H[1005];
void build(int node) {
  H[h[node]].push_back(node);
  for (int i = 0; i < int(g[node].size()); i++) {
    int child = g[node][i];
    if (child == parent[node]) continue;
    parent[child] = node;
    h[child] = h[node] + 1;
    build(child);
  }
}
bool isAncestor(int child, int p) {
  while (true) {
    if (child == p) return true;
    child = parent[child];
    if (child == -1) break;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 0; i <= n; i++)
      g[i].clear(), parent[i] = -1, h[i] = 0, F[i] = -1, H[i].clear();
    for (int i = 0; i < n - 1; i++) {
      int u, v;
      cin >> u >> v;
      g[u].push_back(v);
      g[v].push_back(u);
    }
    cout << "? " << n;
    for (int i = 1; i <= n; i++) cout << " " << i;
    cout << endl;
    int x, d;
    cin >> x >> d;
    parent[x] = -1;
    build(x);
    int maxH = 0;
    for (int i = 1; i <= n; i++) maxH = max(maxH, h[i]);
    int start = max(0, d / 2 - 1), end = maxH + 1;
    F[0] = x;
    while (end - start > 1) {
      int mid = (end + start) >> 1;
      cout << "? " << H[mid].size();
      for (int i = 0; i < int(H[mid].size()); i++) cout << " " << H[mid][i];
      cout << endl;
      int xx, dd;
      cin >> xx >> dd;
      F[mid] = xx;
      if (dd == d)
        start = mid;
      else
        end = mid;
    }
    int rem = d - start;
    vector<int> v;
    for (int i = 0; i < int(H[rem].size()); i++) {
      if (isAncestor(F[start], H[rem][i])) continue;
      v.push_back(H[rem][i]);
    }
    if (v.size() > 1) {
      cout << "? " << int(v.size());
      for (int i = 0; i < int(H[rem].size()); i++) {
        if (isAncestor(F[start], H[rem][i])) continue;
        cout << " " << H[rem][i];
      }
      cout << endl;
      cin >> x >> d;
    } else if (v.size() == 1) {
      x = v[0];
    }
    cout << "! " << x << " " << F[start] << endl;
    string s;
    cin >> s;
  }
  return 0;
}
