#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> g(1001);
vector<vector<int>> d(1001);
bool vis[1001] = {};
int maxm = 0;
void dfs(int u, int par, int dis) {
  d[dis].push_back(u);
  maxm = ((maxm > dis) ? maxm : dis);
  for (auto &i : g[u]) {
    if (i == par) {
      continue;
    }
    dfs(i, u, dis + 1);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int test = 1;
  cin >> test;
  while (test--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      g[i].clear();
      d[i].clear();
      vis[i] = 0;
      maxm = 0;
    }
    d[0].clear();
    for (int i = 1; i < n; i++) {
      int u, v;
      cin >> u >> v;
      g[u].push_back(v);
      g[v].push_back(u);
    }
    cout << "? " << n << " ";
    int node;
    int dist;
    for (int i = 1; i <= n; i++) {
      cout << i << " ";
    }
    cout << endl;
    cout.flush();
    cin >> node >> dist;
    if (node == -1) {
      break;
    }
    dfs(node, -1, 0);
    int l, r = ((dist > maxm) ? maxm : dist);
    if (dist % 2 == 0) {
      l = dist / 2;
    } else {
      l = (dist + 1) / 2;
    }
    int ans;
    int n1, n2;
    while (l <= r) {
      int temp, t1;
      int mid = (l + r) / 2;
      int siz = d[mid].size();
      cout << "? " << siz << " ";
      for (int i = 0; i < siz; i++) {
        cout << d[mid][i] << " ";
      }
      cout << endl;
      cout.flush();
      cin >> temp >> t1;
      if (temp == -1) {
        break;
      }
      if (t1 == dist) {
        ans = mid;
        n1 = temp;
        l = mid + 1;
      } else {
        r = mid - 1;
      }
    }
    queue<pair<int, int>> q;
    int cnt = 0;
    q.push({n1, 0});
    vis[n1] = 1;
    vector<int> nodes;
    while (!q.empty()) {
      int u = q.front().first;
      int dis = q.front().second;
      q.pop();
      for (auto &i : g[u]) {
        if (!vis[i]) {
          q.push({i, dis + 1});
          vis[i] = 1;
          if ((dis + 1) == dist) {
            nodes.push_back(i);
          }
        }
      }
    }
    cout << "? " << nodes.size() << " ";
    for (int i = 0; i < nodes.size(); i++) {
      cout << nodes[i] << " ";
    }
    cout << endl;
    cout.flush();
    cin >> n2 >> ans;
    if (n2 == -1) {
      break;
    }
    cout << "! " << n2 << " " << n1 << endl;
    cout.flush();
    string tem;
    cin >> tem;
    if (tem == "Correct") {
      continue;
    } else {
      break;
    }
  }
  return 0;
}
