#include <bits/stdc++.h>
using namespace std;
const int max_n = 1002;
vector<int> briaunos[max_n];
int dist[max_n][max_n];
void rask_atstumus(int n) {
  for (int i = 1; i <= n; i++) {
    bool aplankyti[max_n];
    for (int j = 0; j < max_n; j++) {
      aplankyti[j] = false;
      dist[i][j] = max_n;
    }
    queue<int> eile;
    eile.push(i);
    aplankyti[i] = true;
    dist[i][i] = 0;
    while (!eile.empty()) {
      int g = eile.front();
      eile.pop();
      for (int j = 0; j < briaunos[g].size(); j++) {
        int kitas = briaunos[g][j];
        if (dist[i][kitas] > dist[i][g] + 1) {
          dist[i][kitas] = dist[i][g] + 1;
          eile.push(kitas);
        }
      }
    }
  }
}
int rask_gala(int pradine, int tevas, int reikalingas, int n, int m) {
  for (int i = 9; i >= 0; i--) {
    vector<int> klausimas;
    int atstumas = (1 << i);
    if ((1 << i) > reikalingas - m) continue;
    for (int j = 1; j <= n; j++) {
      if ((dist[pradine][j] == atstumas) &&
          (dist[tevas][j] == dist[tevas][pradine] + dist[pradine][j]))
        klausimas.push_back(j);
    }
    if (klausimas.size() == 0) continue;
    cout << "? " << klausimas.size();
    for (int i = 0; i < klausimas.size(); i++) cout << " " << klausimas[i];
    cout << endl;
    int kuris, kiek;
    cin >> kuris >> kiek;
    if (kiek == reikalingas) {
      pradine = kuris;
    }
  }
  return pradine;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 0; i <= n; i++) briaunos[i].clear();
    for (int i = 1; i < n; i++) {
      int a, b;
      cin >> a >> b;
      briaunos[a].push_back(b);
      briaunos[b].push_back(a);
    }
    rask_atstumus(n);
    cout << "? " << n << " ";
    for (int i = 1; i <= n; i++) cout << i << " ";
    cout << endl;
    int virsune;
    int atstumas;
    cin >> virsune >> atstumas;
    vector<int> kitos_ieskant;
    int m = atstumas / 2;
    for (int i = 1; i <= n; i++) {
      if (dist[i][virsune] == m) kitos_ieskant.push_back(i);
    }
    cout << "? " << kitos_ieskant.size();
    for (int i = 0; i < kitos_ieskant.size(); i++)
      cout << " " << kitos_ieskant[i];
    cout << endl;
    int kita, kitas_atstumas;
    cin >> kita >> kitas_atstumas;
    if (kitas_atstumas != atstumas) return 0;
    int pirmas = rask_gala(kita, virsune, atstumas, n, m);
    vector<int> kiti;
    for (int i = 1; i <= n; i++) {
      if (dist[pirmas][i] == atstumas) kiti.push_back(i);
    }
    cout << "? " << kiti.size();
    for (int i = 0; i < kiti.size(); i++) cout << " " << kiti[i];
    cout << endl;
    int antras;
    cin >> antras >> atstumas;
    cout << "! " << pirmas << " " << antras << endl;
    string ats;
    cin >> ats;
    if (ats == "Incorrect") return 0;
  }
  return 0;
}
