#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
vector<vector<ll>> adj;
pair<ll, ll> query(vector<ll> in) {
  if (in.empty())
    for (ll x = 0; x < (ll)(adj).size(); x++) in.push_back(x);
  cout << "? " << (ll)(in).size();
  for (ll x : in) cout << " " << x + 1;
  cout << endl;
  ll x, d;
  cin >> x >> d;
  x--;
  if (x < 0) exit(0);
  return {x, d};
}
void solve(ll x, ll y) {
  cout << "! " << x + 1 << " " << y + 1 << endl;
  string res;
  cin >> res;
  if (res == "Incorrect") exit(0);
}
vector<ll> todo;
void findDist(ll c, ll gd, ll p = -1, ll cd = 0) {
  if (cd == gd) {
    todo.push_back(c);
  } else if (cd < gd) {
    for (ll x : adj[c]) {
      if (x == p) continue;
      findDist(x, gd, c, cd + 1);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ll t;
  cin >> t;
  for (ll i = 0; i < t; i++) {
    ll n;
    cin >> n;
    adj.assign(n, {});
    for (ll j = 1; j < n; j++) {
      ll a, b;
      cin >> a >> b;
      a--;
      b--;
      adj[a].push_back(b);
      adj[b].push_back(a);
    }
    if (n == 2) {
      solve(0, 1);
      continue;
    }
    auto mid = query({});
    auto border = mid;
    ll l = mid.second / 2 - 1;
    ll r = 10000;
    while (l + 1 < r) {
      ll m = (l + r) / 2;
      todo.clear();
      findDist(mid.first, m);
      if (todo.empty()) {
        r = m;
      } else {
        auto ans = query(todo);
        if (ans.second != mid.second) {
          r = m;
        } else {
          border = ans;
          l = m;
        }
      }
    }
    ll firstAns = border.first;
    todo.clear();
    findDist(firstAns, mid.second);
    auto other = query(todo);
    solve(firstAns, other.first);
  }
}
