#include <bits/stdc++.h>
using namespace std;
const int mx = 200005;
vector<int> v[mx], dis[mx];
bool vis[mx];
pair<int, int> query(vector<int> q) {
  cout << "? " << q.size() << " ";
  for (auto i : q) cout << i << " ";
  cout << endl;
  cout << flush;
  int x, d;
  cin >> x >> d;
  return {x, d};
}
void dfs(int x, int p, int d) {
  dis[d].push_back(x);
  for (auto i : v[x]) {
    if (i == p) continue;
    dfs(i, x, d + 1);
  }
}
bool dfs_mark(int x, int p, int d) {
  if (x == d) {
    vis[x] = 1;
    return 1;
  }
  for (auto i : v[x]) {
    if (i == p) continue;
    vis[x] |= dfs_mark(i, x, d);
  }
  return vis[x];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 0; i <= 2501; ++i) {
      v[i].clear();
      vis[i] = 0;
      dis[i].clear();
    }
    for (int i = 1; i < n; ++i) {
      int x, y;
      cin >> x >> y;
      v[x].push_back(y);
      v[y].push_back(x);
    }
    vector<int> q;
    for (int i = 1; i <= n; ++i) {
      q.push_back(i);
    }
    auto z = query(q);
    int root = z.first;
    dfs(z.first, 0, 0);
    int ans = z.second;
    int low = z.second / 2, high = z.second;
    int ans1 = -1;
    while (low < high) {
      int mid = (low + high) / 2 + (low + high) % 2;
      if (dis[mid].size() == 0) {
        high = mid - 1;
        continue;
      }
      z = query(dis[mid]);
      if (z.second == ans) {
        ans1 = z.first;
        low = mid;
      } else
        high = mid - 1;
    }
    if (ans1 == -1) ans1 = query(dis[low]).first;
    int req = ans - low;
    q.clear();
    dfs_mark(root, 0, ans1);
    vis[root] = 0;
    for (auto i : dis[req]) {
      if (i == ans1 || vis[i]) continue;
      q.push_back(i);
    }
    z = query(q);
    cout << "! " << ans1 << " " << z.first << endl;
    string s;
    cin >> s;
    assert(s != "Incorrect");
  }
}
