#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
pair<int, int> query(vector<int> q) {
  cout << "? " << q.size() << " ";
  for (int i = 0; i < q.size(); i++) {
    cout << q[i] << " ";
  }
  cout << endl;
  pair<int, int> in;
  cin >> in.first >> in.second;
  return in;
}
vector<int> gr[N];
int depth[N];
void getd(int node, int dad) {
  depth[node] = 1 + depth[dad];
  for (auto x : gr[node]) {
    if (x != dad) getd(x, node);
  }
}
pair<int, int> ans;
void clr(int n) {
  for (int i = 1; i <= n; i++) gr[i].clear(), depth[i] = 0;
  ans = {0, 0};
}
bool askq(int d, int n, int dist) {
  vector<int> q;
  for (int i = 1; i <= n; i++) {
    if (depth[i] == d) {
      q.push_back(i);
    }
  }
  if (q.empty()) return false;
  ans = query(q);
  if (ans.second == dist) return true;
  return false;
}
void getd(int nod, int dad, vector<int> &q, int dgood, int dc) {
  if (dc == dgood) {
    q.push_back(nod);
    return;
  }
  for (auto x : gr[nod]) {
    if (x != dad) {
      getd(x, nod, q, dgood, dc + 1);
    }
  }
}
void solve() {
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    gr[x].push_back(y);
    gr[y].push_back(x);
  }
  vector<int> q;
  for (int i = 1; i <= n; i++) {
    q.push_back(i);
  }
  depth[0] = -1;
  auto q1 = query(q);
  int root = q1.first;
  int dist = q1.second;
  getd(root, 0);
  int st = dist / 2, dr = dist + 1;
  int nodel = root;
  while (st <= dr) {
    int mid = (st + dr) / 2;
    if (askq(mid, n, dist)) {
      st = mid + 1;
      nodel = ans.first;
    } else {
      dr = mid - 1;
    }
  }
  q.clear();
  assert((nodel >= 1 && nodel <= n));
  getd(nodel, 0, q, dist, 0);
  ans = query(q);
  int noder = ans.first;
  cout << "! " << nodel << " " << noder << endl;
  string s;
  cin >> s;
  clr(n);
}
int main() {
  int nrt;
  cin >> nrt;
  for (int i = 1; i <= nrt; i++) {
    solve();
  }
  return 0;
}
