#include <bits/stdc++.h>
using namespace std;
long long add(long long a, long long b) {
  a %= 1000000007;
  b %= 1000000007;
  long long p = (a + b) % 1000000007;
  return (p + 1000000007) % 1000000007;
}
long long mul(long long a, long long b) {
  a %= 1000000007;
  b %= 1000000007;
  long long p = (a * b) % 1000000007;
  return (p + 1000000007) % 1000000007;
}
pair<long long, long long> query(vector<long long> v) {
  fflush(stdout);
  cout << "? " << (int)(v).size() << " ";
  for (long long i = 0; i < (int)(v).size(); i++) cout << v[i] << " ";
  cout << endl;
  long long ind, d;
  cin >> ind >> d;
  fflush(stdout);
  return {ind, d};
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long i, j, n;
    cin >> n;
    vector<long long> adj[1010];
    for (i = 0; i < n - 1; i++) {
      long long u, v;
      cin >> u >> v;
      adj[u].push_back(v);
      adj[v].push_back(u);
    }
    long long r, len;
    vector<long long> v;
    for (i = 1; i <= n; i++) v.push_back(i);
    pair<long long, long long> p = query(v);
    r = p.first;
    len = p.second;
    queue<long long> q;
    q.push(r);
    vector<long long> dis(n + 10, 0), mrk(n + 10, 0);
    vector<long long> depth[1010];
    while (!q.empty()) {
      long long x = q.front();
      mrk[x] = 1;
      depth[dis[x]].push_back(x);
      q.pop();
      for (j = 0; j < adj[x].size(); j++) {
        long long y = adj[x][j];
        if (mrk[y]) continue;
        dis[y] = dis[x] + 1;
        q.push(y);
      }
    }
    long long low = (len + 1) / 2, high = len, mid, ans = -1;
    ;
    while (low <= high) {
      mid = (low + high) / 2;
      if (!(int)(depth[mid]).size()) {
        high = mid - 1;
        continue;
      }
      pair<long long, long long> p = query(depth[mid]);
      if (p.second == len) {
        ans = p.first;
        low = mid + 1;
      } else
        high = mid - 1;
    }
    assert(ans != -1);
    vector<long long> dis1(n + 10, 0), mrk1(n + 10, 0);
    vector<long long> depth1[1010];
    q.push(ans);
    while (!q.empty()) {
      long long x = q.front();
      mrk1[x] = 1;
      depth1[dis1[x]].push_back(x);
      q.pop();
      for (j = 0; j < adj[x].size(); j++) {
        long long y = adj[x][j];
        if (mrk1[y]) continue;
        dis1[y] = dis1[x] + 1;
        q.push(y);
      }
    }
    pair<long long, long long> p1 = query(depth1[len]);
    long long ans2 = p1.first;
    cout << "! " << ans << " " << ans2 << endl;
    string str;
    cin >> str;
    if (str == "Incorrect") break;
  }
  return 0;
}
