#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
const long long ML = 4e18;
void query(vector<int>& a) {
  cout << "? " << a.size();
  for (int i : a) cout << " " << i;
  cout << endl;
  fflush(stdout);
}
void solve() {
  int n;
  cin >> n;
  vector<vector<int>> edges(n + 1);
  for (int i = (0); i < (n - 1); ++i) {
    int a, b;
    cin >> a >> b;
    edges[a].push_back(b);
    edges[b].push_back(a);
  }
  vector<int> a(n);
  for (int i = (0); i < (n); ++i) a[i] = i + 1;
  int x, d;
  query(a);
  cin >> x >> d;
  queue<pair<int, int>> q;
  vector<vector<int>> rs;
  q.push({x, 0});
  vector<int> f(n + 1);
  f[x] = 0;
  while (!q.empty()) {
    int sz = q.size();
    vector<int> r;
    for (int i = (0); i < (sz); ++i) {
      pair<int, int> p = q.front();
      q.pop();
      r.push_back(p.first);
      for (int j : edges[p.first]) {
        if (j == p.second) continue;
        q.push({j, p.first});
        f[j] = p.first;
      }
    }
    rs.push_back(r);
  }
  int low = (d + 1) / 2, high = min(d, int(rs.size() - 1));
  int ans = -1, rx, rd;
  while (low < high) {
    int mid = (low + high + 1) / 2;
    query(rs[mid]);
    cin >> rx >> rd;
    if (rd == d) {
      low = mid;
      ans = rx;
    } else {
      high = mid - 1;
    }
  }
  if (ans == -1) {
    query(rs[high]);
    cin >> ans >> rd;
  }
  string ok;
  if (low == d) {
    cout << "! " << x << " " << ans << endl;
    cin >> ok;
    fflush(stdout);
    return;
  }
  int p = d - low;
  set<int> st;
  int cur = ans;
  while (cur) {
    st.insert(cur);
    cur = f[cur];
  }
  vector<int> last;
  for (int i : rs[p]) {
    if (!st.count(i)) last.push_back(i);
  }
  int res = -1;
  query(last);
  cin >> res >> d;
  cout << "! " << res << " " << ans << endl;
  cin >> ok;
  fflush(stdout);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int T;
  cin >> T;
  for (int kase = 1; kase <= T; ++kase) {
    solve();
  }
  return 0;
}
