#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
vector<vector<int> > E;
int n;
pair<int, int> read(vector<int> A) {
  cout << "? " << A.size() << " ";
  for (auto a : A) cout << a + 1 << " ";
  cout << endl;
  int x, d;
  cin >> x >> d;
  return pair<int, int>(x - 1, d);
}
int dist[1020];
void dfs(int at, int distance, int parent) {
  dist[at] = distance;
  for (auto a : E[at]) {
    if (a == parent) continue;
    dfs(a, distance + 1, at);
  }
}
vector<int> PEPS(int main_vertex, int distance) {
  memset(dist, -1, sizeof(dist));
  dfs(main_vertex, 0, -1);
  vector<int> PEP;
  for (auto i = (0); i < (n); i++)
    if (dist[i] == distance) PEP.push_back(i);
  return PEP;
}
int main() {
  cin.sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    E = vector<vector<int> >(n, vector<int>());
    for (auto i = (0); i < (n - 1); i++) {
      int u, v;
      cin >> u >> v;
      u--;
      v--;
      E[u].push_back(v);
      E[v].push_back(u);
    }
    vector<int> ALL;
    for (auto i = (0); i < (n); i++) ALL.push_back(i);
    pair<int, int> G = read(ALL);
    int main_vertex = G.first;
    int distance = G.second;
    int lo = 1, hi = distance;
    int bst = 1;
    int vertex = 1;
    while (lo <= hi) {
      int mid = (lo + hi) / 2;
      vector<int> ASK = PEPS(main_vertex, mid);
      if (ASK.size() == 0) {
        hi = mid - 1;
        continue;
      }
      pair<int, int> GOT = read(ASK);
      if (GOT.second == distance) {
        bst = mid;
        lo = mid + 1;
        vertex = GOT.first;
      } else {
        hi = mid - 1;
      }
    }
    pair<int, int> LAST_V = read(PEPS(vertex, distance));
    cout << "! " << vertex + 1 << " " << LAST_V.first + 1 << endl;
    string ans;
    cin >> ans;
  }
}
