#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const long long dirx[4] = {0, 0, -1, 1};
const long long diry[4] = {-1, 1, 0, 0};
void FASTIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const long long mxN = 2e3 + 100;
long long n, m, k, q;
long long ans;
vector<long long> v[mxN];
long long d[mxN][mxN];
map<vector<long long>, pair<long long, long long> > dp;
void dfs(long long node, long long org, long long p = 0, long long l = 0) {
  d[org][node] = l;
  for (auto child : v[node]) {
    if (child ^ p) {
      dfs(child, org, node, l + 1);
    }
  }
}
pair<long long, long long> query(vector<long long> v) {
  if ((long long)(v.size()) == 0) {
    return {-1, -1};
  }
  if (dp.count(v)) return dp[v];
  cout << "? " << (long long)(v.size()) << " ";
  for (long long x : v) cout << x << " ";
  cout << endl;
  pair<long long, long long> p;
  cin >> p.first >> p.second;
  return dp[v] = p;
}
vector<long long> neig(long long node, long long dis) {
  vector<long long> ans;
  for (long long i = 1; i <= n; i++) {
    if (d[node][i] == dis) ans.push_back(i);
  }
  return ans;
}
void test_case() {
  cin >> n;
  dp.clear();
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      d[i][j] = 0;
    }
    v[i].clear();
  }
  for (long long i = 1; i <= n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (long long i = 1; i <= n; i++) {
    dfs(i, i);
  }
  vector<long long> ask;
  for (long long i = 1; i <= n; i++) {
    ask.push_back(i);
  }
  pair<long long, long long> reply = query(ask);
  long long node = reply.first;
  long long dis = reply.second;
  long long s = dis / 2;
  long long e = dis;
  pair<long long, long long> ans;
  while (s <= e) {
    long long mid = (s + e) >> 1;
    reply = query(neig(node, mid));
    if (reply.second > dis or reply.second == -1) {
      e = mid - 1;
    } else {
      ans = reply;
      s = mid + 1;
    }
  }
  long long value = query(neig(ans.first, dis)).first;
  cout << "! " << ans.first << " " << value << endl;
  string response;
  cin >> response;
  if (response != "Correct") {
    cout << -1;
    return;
  }
}
int32_t main() {
  FASTIO();
  long long t;
  t = 1;
  cin >> t;
  for (long long i = 1; i <= t; i++) {
    test_case();
  }
  return 0;
}
