#include <bits/stdc++.h>
using namespace std;
const long long N = 1010, M = 10010, INF = 0x3f3f3f3f;
inline long long Max(long long x, long long y) { return x > y ? x : y; }
inline long long Min(long long x, long long y) { return x < y ? x : y; }
inline void Swap(long long &x, long long &y) { x ^= y ^= x ^= y; }
long long T, n, len, root, d[N];
char c[N];
vector<long long> head[N], S[N];
void add(long long x, long long y) { head[x].push_back(y); }
void hclear() {
  for (long long i = 0; i <= n; i++) head[i].clear();
}
void sclear() {
  for (long long i = 0; i <= n; i++) S[i].clear();
}
void QueryAll() {
  std::cout << "? " << n << " ";
  for (long long i = 1; i <= n; i++) std::cout << i << " ";
  std::cout << std::endl;
}
void QueryDis(long long dis) {
  std::cout << "? " << (long long)S[dis].size() << " ";
  for (long long i = 0; i < (long long)S[dis].size(); i++)
    std::cout << S[dis][i] << " ";
  std::cout << std::endl;
}
void dfs(long long x, long long fa) {
  S[d[x]].push_back(x);
  for (long long i = 0; i < (long long)head[x].size(); i++) {
    long long y = head[x][i];
    if (y == fa) continue;
    d[y] = d[x] + 1;
    dfs(y, x);
  }
}
bool check(long long dis, long long &x, long long &l) {
  if (!S[dis].size()) return 0;
  QueryDis(dis);
  std::cin >> x >> l;
  return l == len;
}
void binary_search(long long L, long long R, long long &x, long long &l) {
  long long lx, ly;
  while (L <= R) {
    long long mid = (L + R) >> 1;
    if (check(mid, x, l))
      lx = x, ly = l, L = mid + 1;
    else
      R = mid - 1;
  }
  x = lx, l = ly;
}
int main() {
  std::cin >> T;
  while (T--) {
    hclear();
    sclear();
    root = len = 0;
    memset(d, 0, sizeof(d));
    std::cin >> n;
    for (long long i = 1; i < n; i++) {
      long long x, y;
      std::cin >> x >> y;
      add(x, y), add(y, x);
    }
    QueryAll();
    std::cin >> root >> len;
    dfs(root, 0);
    long long a, b, res;
    binary_search((len - 1) / 2 + 1, len, a, res);
    sclear();
    memset(d, 0, sizeof(d));
    dfs(a, 0);
    QueryDis(len);
    std::cin >> b >> len;
    std::cout << "! " << a << " " << b;
    std::cout << std::endl;
    std::cin >> c;
    if (c[0] != 'C') break;
  }
  return 0;
}
