#include <bits/stdc++.h>
using namespace std;
const int N = 1100;
const int M = 160;
const int mod = 1e9 + 7;
const long long MOD = 998244353;
const long double eps = 0.00000000001;
const int inf = 1e9 + 7;
mt19937 gen(time(0));
vector<int> g[N], ve, h[N];
int kol = 0;
pair<int, int> ask() {
  kol++;
  if (kol > 14) {
    while (1)
      ;
  }
  cout << "? " << ve.size() << " ";
  for (auto to : ve) {
    cout << to + 1 << " ";
  }
  cout << endl;
  int x, y;
  cin >> x >> y;
  x--;
  return {x, y};
}
void DFS(int v, int pr, int r) {
  if (r) h[r].push_back(v);
  for (auto to : g[v]) {
    if (to == pr) continue;
    DFS(to, v, r + 1);
  }
}
void solve() {
  int n;
  cin >> n;
  kol = 0;
  ve.clear();
  for (int i = 0; i < n; i++) {
    g[i].clear();
    ve.push_back(i);
  }
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  pair<int, int> p = ask();
  int v = p.first, rast = p.second;
  for (int i = 0; i <= n + 5; i++) h[i].clear();
  DFS(v, v, 0);
  int l = 1, r = n, fi = v;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (h[mid].size() == 0) {
      r = mid - 1;
      continue;
    }
    ve.clear();
    for (auto to : h[mid]) {
      ve.push_back(to);
    }
    p = ask();
    if (p.second == rast) {
      fi = p.first;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  for (int i = 0; i <= n + 5; i++) h[i].clear();
  DFS(fi, fi, 0);
  ve.clear();
  for (auto to : h[rast]) {
    ve.push_back(to);
  }
  p = ask();
  cout << "! " << fi + 1 << " " << p.first + 1 << endl;
  string s;
  cin >> s;
  if (s == "Incorrect") exit(0);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
  int T;
  cin >> T;
  while (T--) {
    solve();
  }
}
