#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> g;
vector<vector<int>> nodes;
void yn(bool a) {
  if (a) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
void dfs(int curr, int par, int dist, int currdist) {
  nodes[currdist].push_back(curr);
  if (currdist == dist) {
    return;
  }
  for (auto child : g[curr]) {
    if (child != par) {
      dfs(child, curr, dist, currdist + 1);
    }
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    g.clear();
    nodes.clear();
    int n;
    cin >> n;
    g.resize(n + 1);
    int a, b;
    for (int i = 1; i < n; i++) {
      cin >> a >> b;
      g[a].push_back(b);
      g[b].push_back(a);
    }
    cout << "? " << n << " ";
    for (int i = 1; i <= n; i++) {
      cout << i << " ";
    }
    cout << endl;
    int dist, node;
    cin >> node >> dist;
    nodes.resize(dist + 1);
    dfs(node, -1, dist, 0);
    int lo = 0, hi = dist, mid, currd, ans, te;
    while (lo < hi) {
      mid = lo + (hi - lo + 1) / 2;
      if (nodes[mid].size() == 0) {
        hi = mid - 1;
        continue;
      }
      cout << "? " << nodes[mid].size() << " ";
      for (auto nodee : nodes[mid]) {
        cout << nodee << " ";
      }
      cout << endl;
      cin >> te >> currd;
      if (currd == dist) {
        ans = te;
        lo = mid;
      } else {
        hi = mid - 1;
      }
    }
    nodes.clear();
    nodes.resize(dist + 1);
    dfs(ans, -1, dist, 0);
    cout << "? " << nodes[dist].size() << " ";
    for (auto nodee : nodes[dist]) {
      if (nodee != ans) {
        cout << nodee << " ";
      }
    }
    cout << endl;
    cin >> te >> currd;
    cout << "! " << ans << " " << te << endl;
    string s;
    cin >> s;
  }
}
