#include <bits/stdc++.h>
using namespace std;
using cd = complex<double>;
const int Inf = 2e9;
const int mod = 998244353;
const double Pi = acos(-1);
void Fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int n, s, t, dis = 0;
vector<int> Adj[1005];
set<int> H[1005];
void DFS(int node, int p = -1, int h = 0) {
  H[h].insert(node);
  for (auto x : Adj[node]) {
    if (x != p) {
      DFS(x, node, h + 1);
    }
  }
}
string k;
int main() {
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 0; i <= n; i++) {
      Adj[i].clear();
      H[i].clear();
    }
    for (int i = 1; i <= n - 1; i++) {
      int u, v;
      cin >> u >> v;
      Adj[u].emplace_back(v);
      Adj[v].emplace_back(u);
    }
    s = 0;
    t = 0;
    cout << "? ";
    cout << n;
    for (int i = 1; i <= n; i++) {
      cout << ' ' << i;
    }
    cout << endl;
    int temp;
    cin >> temp >> dis;
    DFS(temp);
    int ps = 0;
    int l = (dis - 1) / 2, r = dis + 1;
    while (l < r) {
      int mid = (l + r + 1) >> 1;
      if (H[mid].size() == 0) {
        r = mid - 1;
        continue;
      }
      cout << "? ";
      cout << H[mid].size() << ' ';
      for (auto x : H[mid]) {
        cout << x << ' ';
      }
      ps = s;
      cout << endl;
      cin >> s >> t;
      if (t == dis) {
        l = mid;
      } else {
        r = mid - 1;
        s = ps;
      }
    }
    cout << "? ";
    for (int i = 0; i <= n; i++) {
      H[i].clear();
    }
    DFS(s);
    cout << H[dis].size() << ' ';
    for (auto x : H[dis]) {
      cout << x << ' ';
    }
    cin >> t >> dis;
    cout << "! " << s << ' ' << t << endl;
    cin >> k;
  }
}
