#include <bits/stdc++.h>
using namespace std;
vector<long long> edj[1010], len[1010], V;
long long root, fixed_len;
void dfs(long long node, long long cnt, long long parent, long long ck) {
  for (long long i : edj[node]) {
    if (parent != i) {
      if (ck == 1) {
        len[cnt + 1].push_back(i);
      } else {
        if (cnt + 1 == fixed_len) {
          V.push_back(i);
        }
      }
      dfs(i, cnt + 1, node, ck);
    }
  }
}
void query(long long n) {
  long long siz = len[n].size();
  cout << "? " << siz;
  for (long long i : len[n]) {
    cout << " " << i;
  }
  cout << "\n";
  ;
}
int main() {
  cout.flush();
  long long tcase = 1;
  cin >> tcase;
  for (long long test = 1; test <= tcase; test++) {
    long long n;
    cin >> n;
    for (long long i = 0; i <= 1000; i++) {
      len[i].clear();
      edj[i].clear();
    }
    V.clear();
    for (long long i = 1; i < n; i++) {
      long long u, v;
      cin >> u >> v;
      edj[u].push_back(v);
      edj[v].push_back(u);
    }
    cout << "? " << n;
    for (long long i = 1; i <= n; i++) cout << " " << i;
    cout << "\n";
    ;
    cin >> root >> fixed_len;
    dfs(root, 0, -1, 1);
    long long left = max(1LL, fixed_len / 2), right = fixed_len, node1 = root,
              node2, x;
    long long tm = root, le = 1;
    while (left < right) {
      long long mid = (left + right) / 2;
      if ((long long)len[mid].size() > 0) {
        query(mid);
        cin >> tm >> le;
      } else {
        le = fixed_len + 1;
      }
      if (le > fixed_len) {
        right = mid - 1;
      } else {
        node1 = tm;
        left = mid + 1;
      }
    }
    long long siz = len[left].size();
    if (siz > 0) {
      query(left);
      cin >> tm >> le;
      if (le == fixed_len) {
        node1 = tm;
      }
    }
    dfs(node1, 0, -1, 0);
    siz = V.size();
    cout << "? " << siz;
    for (long long i = 0; i < siz; i++) {
      cout << " " << V[i];
    }
    cout << "\n";
    ;
    cin >> node2 >> x;
    string second;
    cout << "! " << node1 << " " << node2 << "\n";
    cin >> second;
  }
}
