#include <bits/stdc++.h>
using namespace std;
const int MAX = 1004, inf = 0x3f3f3f3f;
vector<int> pr[MAX], ad[MAX], res;
int H, n;
int h[MAX];
pair<int, int> a[MAX];
void DFS(int v, int trc) {
  h[v] = h[trc] + 1;
  ad[h[v]].push_back(v);
  H = max(H, h[v]);
  for (int u : pr[v])
    if (u != trc) {
      DFS(u, v);
    }
}
void DO(int v) {
  h[v] = 0;
  ad[h[v]].push_back(v);
  for (int u : pr[v]) {
    DFS(u, v);
  }
}
void get(int v) {
  cout << "? " << ad[v].size();
  for (int u : ad[v]) {
    cout << ' ' << u;
  }
  cout << '\n';
  fflush(stdout);
  return;
}
int now1, now2;
bool CHECK(int v, int trc) {
  bool ttt = 0;
  for (int u : pr[v])
    if (u != trc) {
      ttt |= CHECK(u, v);
    }
  ttt |= (v == now2);
  if (h[v] == now1 && !ttt) res.push_back(v);
  return ttt;
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    cin >> n;
    H = 0;
    for (int i = 1, x, y; i < n; i++) {
      cin >> x >> y;
      pr[x].push_back(y);
      pr[y].push_back(x);
    }
    cout << "? " << n;
    for (int i = 1; i <= n; i++) {
      cout << ' ' << i;
    }
    cout << '\n';
    fflush(stdout);
    int v, dis;
    cin >> v >> dis;
    a[0] = pair<int, int>(v, dis);
    DO(v);
    int b = max(1, dis / 2), e = min(H, dis);
    int ans = 0;
    while (b <= e) {
      int m = b + e >> 1;
      get(m);
      cin >> a[m].first >> a[m].second;
      if (a[m].second > dis) {
        e = m - 1;
      } else {
        ans = m;
        b = m + 1;
      }
    }
    if (dis == ans) {
      cout << "! " << a[ans].first << ' ' << v << '\n';
    } else {
      now1 = dis - ans;
      now2 = a[ans].first;
      CHECK(v, 0);
      cout << "? " << res.size();
      for (int u : res) {
        cout << ' ' << u;
      }
      cout << '\n';
      fflush(stdout);
      int ronal;
      cin >> ronal >> now1;
      cout << "! " << a[ans].first << ' ' << ronal << '\n';
    }
    fflush(stdout);
    string st;
    cin >> st;
    res.clear();
    for (int i = 0; i <= n; i++) {
      pr[i].clear();
      ad[i].clear();
      a[i].first = 0;
    }
  }
}
