#include <bits/stdc++.h>
using namespace std;
const int MAXN = 4010;
int n;
vector<int> v[MAXN];
pair<int, int> pitaj(vector<int> &q) {
  if (q.empty()) return make_pair(-1, -1);
  printf("? %d\n", (int)q.size());
  set<int> s;
  for (auto x : q) {
    s.insert(x);
    assert(x >= 1 && x <= n);
    printf("%d ", x);
  }
  puts("");
  fflush(stdout);
  int a, b;
  scanf("%d %d", &a, &b);
  assert(a != -1);
  return make_pair(a, b);
}
vector<int> dub[MAXN];
int bio[MAXN];
void bfs(int st) {
  for (int i = (1); i < int(n + 1); i++) dub[i].clear();
  int cvor;
  for (int i = (1); i < int(n + 1); i++) bio[i] = 0;
  bio[st] = 1;
  queue<int> q;
  q.push(st);
  bio[st] = 1;
  q.push(0);
  int d;
  while (!q.empty()) {
    cvor = q.front();
    q.pop();
    d = q.front();
    q.pop();
    dub[d].push_back(cvor);
    for (auto ncvor : v[cvor]) {
      if (!bio[ncvor]) {
        bio[ncvor] = 1;
        q.push(ncvor);
        q.push(d + 1);
      }
    }
  }
}
int dist;
void solve() {
  scanf("%d", &n);
  for (int i = (1); i < int(n + 1); i++) v[i].clear();
  for (int i = (0); i < int(n - 1); i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    v[a].push_back(b);
    v[b].push_back(a);
  }
  vector<int> q;
  for (int i = (1); i < int(n + 1); i++) q.push_back(i);
  auto t = pitaj(q);
  dist = t.second;
  bfs(t.first);
  int last = -1;
  int lo = dist / 2, hi = dist, mid;
  map<int, pair<int, int> > M;
  while (lo != hi) {
    mid = (lo + hi + 1) / 2;
    auto nt = pitaj(dub[mid]);
    M[mid] = nt;
    if (nt.second != dist)
      hi = mid - 1;
    else {
      lo = mid;
      last = nt.first;
    }
  }
  pair<int, int> nt = {-1, -1};
  if (M.count(lo))
    nt = M[lo];
  else
    nt = pitaj(dub[lo]);
  last = nt.first;
  int A, B = last;
  bfs(last);
  auto ans = pitaj(dub[dist]);
  A = ans.first;
  printf("! %d %d\n", A, B);
  fflush(stdout);
  char buff[20];
  scanf("%s", buff);
  assert(buff[0] != 'I');
  for (int i = (1); i < int(n + 1); i++) dub[i].clear();
  for (int i = (1); i < int(n + 1); i++) v[i].clear();
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
