#include <bits/stdc++.h>
using namespace std;
long long fact(long long n) {
  if (n == 0 || n == 1)
    return 1;
  else
    return n * fact(n - 1);
}
long long power(long long base, long long exp) {
  long long res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = ((res % 1000000007) * (base % 1000000007));
    base = ((base % 1000000007) * (base % 1000000007));
    exp /= 2;
  }
  return res % 1000000007;
}
long long n, k;
vector<long long> v[1001];
long long sd[1001];
long long vis[1001];
long long par[1001];
long long ini(long long x) {
  for (long long i = 0; i < n + 1; i++) {
    sd[i] = 0;
    vis[i] = 0;
    par[i] = 0;
  }
  queue<long long> q;
  q.push(x);
  vis[x] = 1;
  par[x] = x;
  while ((long long)q.size()) {
    long long s = q.front();
    q.pop();
    for (long long i = 0; i < (long long)v[s].size(); i++) {
      if (vis[v[s][i]] == 0) {
        q.push(v[s][i]);
        sd[v[s][i]] = sd[s] + 1;
        vis[v[s][i]] = 1;
        par[v[s][i]] = s;
      }
    }
  }
  return 0;
}
int solve() {
  cin >> n;
  for (long long i = 0; i < n - 1; i++) {
    long long x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  cout << "? " << n << " ";
  for (long long i = 0; i < n; i++) cout << i + 1 << " ";
  cout << '\n';
  cout.flush();
  long long d, x;
  cin >> x >> d;
  ini(x);
  map<long long, vector<long long> > m;
  for (long long i = 1; i < n + 1; i++) m[sd[i]].push_back(i);
  long long en = 0;
  for (long long i = 1; i < n + 1; i++) en = max(en, sd[i]);
  long long st = (d + 1) / 2;
  en = min(d + 1, en + 1);
  long long mid;
  long long mx = -1, md = st;
  while (st < en) {
    mid = (st + en) / 2;
    cout << "? " << (long long)m[mid].size() << " ";
    for (long long i = 0; i < (long long)m[mid].size(); i++)
      cout << m[mid][i] << " ";
    cout << '\n';
    cout.flush();
    long long xx = x, dd = d;
    cin >> xx >> dd;
    if (dd == d) {
      st = mid + 1;
      mx = xx;
      md = mid;
    } else
      en = mid;
  }
  if (mx == -1) {
    cout << "? " << (long long)m[md].size() << " ";
    for (long long i = 0; i < (long long)m[md].size(); i++)
      cout << m[md][i] << " ";
    cout << '\n';
    cout.flush();
    long long z;
    cin >> mx >> z;
  }
  ini(mx);
  vector<long long> naruto;
  for (long long i = 0; i < (long long)m[d - md].size(); i++)
    if (sd[m[d - md][i]] == d) naruto.push_back(m[d - md][i]);
  cout << "? " << (long long)naruto.size() << " ";
  for (long long i = 0; i < (long long)naruto.size(); i++)
    cout << naruto[i] << " ";
  cout << '\n';
  cout.flush();
  long long ans, ansd;
  cin >> ans >> ansd;
  cout << "! " << ans << " " << mx << '\n';
  cout.flush();
  string answer;
  cin >> answer;
  for (long long i = 0; i < n + 1; i++) v[i].clear();
  return 0;
}
signed main() {
  int test = 1;
  cin >> test;
  while (test--) {
    solve();
  }
  return 0;
}
