#include <bits/stdc++.h>
using namespace std;
const long long inf = 2e18;
const long long mod = 1e9 + 7;
const long double pi = 3.141592653589793238462643383279502884;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void print(long long a[], long long n) {
  for (long long i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << "\n";
}
long long power(long long x, long long y) {
  if (y <= 0) return 1;
  long long ans = 1;
  x %= mod;
  while (y) {
    if (y & 1) ans = (x * ans) % mod;
    x = (x * x) % mod;
    y >>= 1;
  }
  return ans;
}
long long modInverse(long long n) { return power(n, mod - 2); }
inline long long mul(long long a, long long b) { return (a * b) % mod; }
inline long long sub(long long a, long long b) {
  long long c = a - b;
  if (c < 0) c += mod;
  return c;
}
inline long long add(long long a, long long b) {
  long long c = a + b;
  if (c > mod) c -= mod;
  return c;
}
inline long long divi(long long a, long long b) {
  return mul(a, modInverse(b));
}
const long long N = 1e3 + 1;
vector<long long> adj[N];
vector<long long> level[N];
void bfs(int s, int dis[]) {
  queue<long long> q;
  dis[s] = 0;
  q.push(s);
  while (!q.empty()) {
    long long t = q.front();
    q.pop();
    for (auto u : adj[t]) {
      if (dis[u] > dis[t] + 1) {
        dis[u] = dis[t] + 1;
        q.push(u);
      }
    }
  }
}
pair<long long, long long> query(int m) {
  cout << "? " << level[m].size() << " ";
  for (auto x : level[m]) {
    cout << x << " ";
  }
  cout << endl;
  int r, d;
  cin >> r >> d;
  return {r, d};
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed << setprecision(10);
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    for (int i = 0; i < n - 1; 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 root, dis;
    cin >> root >> dis;
    int d1[n + 1];
    for (int i = 0; i < n + 1; i++) {
      d1[i] = INT_MAX;
    }
    bfs(root, d1);
    int ml = 0;
    for (int i = 1; i <= n; i++) {
      level[d1[i]].push_back(i);
      ml = max(ml, d1[i]);
    }
    int l = dis / 2;
    int r = min(dis, ml);
    int n1, n2;
    while (l <= r) {
      int m = l + (r - l) / 2;
      pair<long long, long long> op = query(m);
      if (op.second == dis) {
        n1 = op.first;
        l = m + 1;
      } else
        r = m - 1;
    }
    int d2[n + 1];
    for (int i = 0; i < n + 1; i++) {
      d2[i] = INT_MAX;
    }
    bfs(n1, d2);
    vector<long long> v;
    for (int i = 1; i <= n; i++) {
      if (d2[i] == dis) v.push_back(i);
    }
    cout << "? " << v.size() << " ";
    for (auto x : v) {
      cout << x << " ";
    }
    cout << endl;
    cin >> n2 >> dis;
    cout << "! " << n1 << " " << n2 << endl;
    string s;
    cin >> s;
    if (s == "Incorrect") return 0;
    for (int i = 0; i < N; i++) {
      adj[i].clear();
      level[i].clear();
    }
  }
  return 0;
}
