#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> adj(1005);
vector<int> v;
pair<int, int> query() {
  cout << "? " << v.size() << " ";
  for (auto it : v) {
    cout << it << " ";
  }
  cout << "\n";
  cout.flush();
  int x, d;
  cin >> x >> d;
  return {x, d};
}
void dfs(int node, int par, int dist, int depth) {
  if (depth == dist) {
    v.push_back(node);
    return;
  }
  for (auto it : adj[node]) {
    if (it != par) {
      dfs(it, node, dist, depth + 1);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      adj[i].clear();
    }
    for (int i = 1; i <= n - 1; i++) {
      int u, v;
      cin >> u >> v;
      adj[u].push_back(v);
      adj[v].push_back(u);
    }
    v.clear();
    for (int i = 1; i <= n; i++) {
      v.push_back(i);
    }
    auto res = query();
    int root = res.first;
    int dist = res.second;
    int lo = 0;
    int hi = n;
    int node1 = -1;
    while (lo <= hi) {
      int mid = (lo + hi) / 2;
      v.clear();
      dfs(root, 0, mid, 0);
      if (v.size() == 0) {
        hi = mid - 1;
        continue;
      }
      auto it = query();
      if (it.second != dist) {
        hi = mid - 1;
      } else {
        node1 = it.first;
        lo = mid + 1;
      }
    }
    v.clear();
    dfs(node1, 0, dist, 0);
    auto it = query();
    int node2 = it.first;
    cout << "! " << node1 << " " << node2 << "\n";
    cout.flush();
    string s;
    cin >> s;
    if (s[0] == 'I') {
      return 0;
    }
  }
}
