#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int b, long long int m) {
  long long int ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans;
}
vector<long long int> v[300009];
vector<long long int> dp[300009];
pair<long long int, long long int> ask(vector<long long int> v1) {
  cout << "? " << v1.size() << " ";
  for (auto it : v1) cout << it << " ";
  cout << endl;
  long long int a, b;
  cin >> a >> b;
  return {a, b};
}
void dfs(long long int num, long long int par, long long int dist) {
  dp[dist].push_back(num);
  for (auto it : v[num]) {
    if (it == par) continue;
    dfs(it, num, dist + 1);
  }
}
void print(long long int a, long long int b) {
  cout << "! " << a << " " << b << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    for (long long int i = 0; i < n + 1; i++) {
      v[i].clear();
      dp[i].clear();
    }
    for (long long int i = 1; i < n; i++) {
      long long int l, r;
      cin >> l >> r;
      v[l].push_back(r);
      v[r].push_back(l);
    }
    vector<long long int> all;
    for (long long int i = 1; i < n + 1; i++) all.push_back(i);
    pair<long long int, long long int> mc = ask(all);
    long long int root = mc.first, l = mc.second;
    dfs(root, 0, 0);
    long long int low = (l + 1) >> 1, high = l;
    long long int pehla_index;
    while (low <= high) {
      long long int mid = (low + high) >> 1;
      if (dp[mid].size() == 0) {
        high = mid - 1;
        continue;
      }
      pair<long long int, long long int> mc = ask(dp[mid]);
      if (mc.second > l)
        high = mid - 1;
      else {
        pehla_index = mc.first;
        low = mid + 1;
      }
    }
    for (long long int i = 0; i < n + 1; i++) dp[i].clear();
    dfs(pehla_index, 0, 0);
    mc = ask(dp[l]);
    print(pehla_index, mc.first);
    string s;
    cin >> s;
    if (s[0] == 'I') return 0;
  }
}
