#include <bits/stdc++.h>
using namespace std;
template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& input) {
  for (auto const& i : input) {
    os << i << " ";
  }
  return os;
}
template <class T1, class T2>
std::ostream& operator<<(std::ostream& os, const std::pair<T1, T2>& input) {
  os << "(" << input.first << ", " << input.second << ')';
  return os;
}
const int maxn = 1000;
int d[maxn], f[maxn];
vector<int> E[maxn], node[maxn];
void dfs(int u, int fa) {
  node[d[u]].push_back(u + 1);
  for (int v : E[u])
    if (v != fa) {
      d[v] = d[u] + 1;
      f[v] = u;
      dfs(v, u);
    }
}
void solve() {
  int n, x, y;
  cin >> n;
  for (int i = 0; i < int(n); ++i) {
    node[i].clear();
    E[i].clear();
  }
  for (int i = 0; i < int(n - 1); ++i) {
    cin >> x >> y;
    x--, y--;
    E[x].push_back(y);
    E[y].push_back(x);
  }
  cout << "? " << n;
  for (int i = 0; i < int(n); ++i) cout << " " << i + 1;
  cout << endl;
  int root, dist;
  cin >> root >> dist;
  root--;
  d[root] = 0;
  dfs(root, -1);
  int l = 0, r = 0;
  for (int i = 0; i < int(n); ++i) r = max(r, d[i]);
  r++;
  int node_u, node_v;
  while (r - l > 1) {
    int m = (l + r) >> 1;
    cout << "? " << (node[m]).size() << " " << node[m] << endl;
    cin >> x >> y;
    x--;
    if (y == dist) {
      node_u = x + 1;
      l = m;
    } else {
      r = m;
    }
  }
  int lv = dist - l;
  if (lv == 0) {
    node_v = root + 1;
  } else {
    int w = node_u - 1;
    for (int i = 0; i < int(l - lv); ++i) {
      w = f[w];
    }
    vector<int> tmp(0);
    for (int x : node[lv])
      if (x != w + 1) tmp.push_back(x);
    cout << "? " << (tmp).size() << " " << tmp << endl;
    cin >> node_v >> y;
    assert(y == dist);
  }
  cout << "! " << node_u << " " << node_v << endl;
  string ret;
  cin >> ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int cas = 1;
  cin >> cas;
  for (int ca = 0; ca < int(cas); ++ca) solve();
  return 0;
}
