#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<int> adj[1001];
bool on_path[1001];
bool cur_query[1001];
int on_path_found = 0;
int cur_path_dis = 0;
int e1 = 0;
int e2 = 0;
int dis[1001];
void dfs(int v) {
  for (auto u : adj[v]) {
    if (!on_path[u] && dis[u] == 0) {
      dis[u] = 1 + dis[v];
      dfs(u);
    }
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 1; i < n; i++) {
      int u, v;
      cin >> u >> v;
      adj[u].push_back(v);
      adj[v].push_back(u);
    }
    cout << "? " << n << " ";
    for (int i = 1; i <= n; i++) cout << i << " ";
    cout << endl;
    int v, path_dis;
    cin >> v >> path_dis;
    on_path_found = 1;
    on_path[v] = 1;
    cur_path_dis = 0;
    e1 = v;
    e2 = v;
    bool exitty = false;
    while (on_path_found <= path_dis) {
      int gap = path_dis - cur_path_dis;
      if (gap % 2 == 1) gap++;
      gap /= 2;
      dfs(e1);
      dfs(e2);
      vector<int> next_query;
      for (int i = 1; i <= n; i++) {
        if (dis[i] >= gap) {
          next_query.push_back(i);
        }
      }
      cout << "? " << int((next_query).size()) << " ";
      for (auto nq : next_query) cout << nq << " ";
      cout << endl;
      int new_on_path, do_this;
      cin >> new_on_path >> do_this;
      int retain_new_on_path = new_on_path;
      while (new_on_path != e1 && new_on_path != e2) {
        on_path_found++;
        cur_path_dis++;
        on_path[new_on_path] = 1;
        for (auto u : adj[new_on_path]) {
          if (dis[u] < dis[new_on_path]) {
            new_on_path = u;
            break;
          }
        }
      }
      if (e1 == new_on_path)
        e1 = retain_new_on_path;
      else
        e2 = retain_new_on_path;
      for (int i = 1; i <= n; i++) {
        cur_query[i] = 0;
        dis[i] = 0;
      }
    }
    cout << "! " << e1 << " " << e2 << endl;
    string corr;
    cin >> corr;
    if (corr == "Incorrect") {
      return 0;
    }
    for (int i = 1; i <= n; i++) {
      while (!adj[i].empty()) adj[i].pop_back();
      on_path[i] = 0;
    }
  }
}
