#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 5;
int n, m, k;
int a[maxn], c[maxn];
int ans, tmp, cnt, rt, sum, ma;
int flag;
char s[maxn];
bool ok[maxn];
vector<int> vc[maxn], vv[maxn];
template <typename T>
inline void read(T &X) {
  X = 0;
  int w = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  if (w) X = -X;
}
pair<int, int> query(int id) {
  printf("? %d", vv[id].size());
  for (int i = 0; i < vv[id].size(); i++) {
    printf(" %d", vv[id][i]);
  }
  puts("");
  fflush(stdout);
  int x, y;
  read(x);
  read(y);
  return make_pair(x, y);
}
void dfs(int u, int fa, int dep) {
  ma = max(ma, dep);
  vv[dep].push_back(u);
  for (int i = 0; i < vc[u].size(); i++) {
    int v = vc[u][i];
    if (v == fa) continue;
    dfs(v, u, dep + 1);
  }
}
int jud(int as) {
  pair<int, int> k = query(as);
  if (k.second > sum) return 1;
  rt = k.first;
  return 0;
}
int main() {
  int T, cas = 1;
  cin >> T;
  while (T--) {
    read(n);
    ans = 0;
    for (int i = (0); i <= (n + 1); i++) {
      vc[i].clear();
      vv[i].clear();
    }
    for (int i = (1); i <= (n - 1); i++) {
      int x, y;
      read(x);
      read(y);
      vc[x].push_back(y);
      vc[y].push_back(x);
      vv[n + 1].push_back(i);
    }
    vv[n + 1].push_back(n);
    pair<int, int> tp = query(n + 1);
    rt = tp.first;
    sum = tp.second;
    ma = 0;
    dfs(rt, -1, 0);
    ma = min(ma, sum);
    int l = (sum + 1) / 2, r = ma + 1, tmp;
    while (l < r) {
      int mid = (l + r) >> 1;
      if (jud(mid)) {
        r = mid;
      } else {
        l = mid + 1;
        tmp = mid;
      }
    }
    for (int i = (0); i <= (n); i++) vv[i].clear();
    dfs(rt, -1, 0);
    tp = query(sum);
    printf("! %d %d\n", rt, tp.first);
    fflush(stdout);
    scanf("%s", s);
  }
  return 0;
}
