#include <bits/stdc++.h>
using namespace std;
vector<int> nei[1001], atDep[1001];
int par[1001], used[1001];
void DFS(int v, int p, int dep) {
  par[v] = p;
  atDep[dep].push_back(v);
  for (int to : nei[v])
    if (to != p) DFS(to, v, dep + 1);
  for (auto it = nei[v].begin(); it != nei[v].end(); ++it)
    if (*it == p) {
      nei[v].erase(it);
      break;
    }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int l = 1, r = 999, cnt = 0;
  while (l <= r) {
    ++cnt;
    int m = l + (r - l) / 2;
    if (m - l > r - m)
      r = m - 1;
    else
      l = m + 1;
  }
  cerr << cnt << " <= 9\n";
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 1; i < n; ++i) {
      int u, v;
      cin >> u >> v;
      nei[u].push_back(v);
      nei[v].push_back(u);
    }
    cout << "? " << n;
    for (int i = 1; i <= n; ++i) cout << ' ' << i;
    cout << endl;
    int root, wayLen;
    cin >> root >> wayLen;
    DFS(root, -1, 0);
    int l = (wayLen + 1) / 2, r = wayLen, mx = 0, ans1 = root, ans2 = root;
    int cnt = 0;
    while (l <= r) {
      if (++cnt > 9) throw;
      int m = l + (r - l) / 2;
      if (atDep[m].empty()) {
        r = m - 1;
        continue;
      }
      cout << "? " << atDep[m].size();
      for (int i : atDep[m]) cout << ' ' << i;
      cout << endl;
      int v, len;
      cin >> v >> len;
      if (len == wayLen) {
        ans1 = v;
        mx = m;
        l = m + 1;
      } else
        r = m - 1;
    }
    int v = ans1;
    while (v != -1) {
      used[v] = true;
      v = par[v];
    }
    vector<int> nodes;
    for (int i : atDep[wayLen - mx])
      if (!used[i]) nodes.push_back(i);
    if (wayLen == mx)
      ans2 = root;
    else if (nodes.size() == 1)
      ans2 = nodes[0];
    else {
      cout << "? " << nodes.size();
      for (int i : nodes) cout << ' ' << i;
      cout << endl;
      int temp;
      cin >> ans2 >> temp;
    }
    cout << "! " << ans1 << ' ' << ans2 << endl;
    string res;
    cin >> res;
    if (res == "Incorrect") exit(0);
    for (int i = 0; i <= n; ++i) {
      atDep[i].clear();
      nei[i].clear();
      used[i] = par[i] = 0;
    }
  }
}
