#include <bits/stdc++.h>
using namespace std;
vector<int> graph[2001];
vector<int> level[2001];
int visited[2001];
int a, b;
void dfs(int u, int depth) {
  visited[u] = 1;
  level[depth].push_back(u);
  for (int v : graph[u]) {
    if (!visited[v]) {
      dfs(v, depth + 1);
    }
  }
}
int query = 0;
void ask(vector<int>& v) {
  cout << "? " << v.size() << " ";
  for (int x : v) {
    cout << x << " ";
  }
  cout << "\n" << flush;
  cin >> a >> b;
}
void bs(int l, int r, int ref) {
  int curr_node = 0, curr_level = 0;
  while (l <= r) {
    if (r - l <= 1) {
      ask(level[r]);
      if (b == ref) {
        curr_level = r;
        curr_node = a;
      } else {
        ask(level[l]);
        curr_node = a;
        curr_level = l;
      }
      break;
    }
    int mid = (l + r) / 2;
    ask(level[mid]);
    if (b == ref) {
      l = mid;
    } else {
      r = mid - 1;
    }
  }
  for (int i = 0; i <= 2000; i++) {
    visited[i] = 0;
    level[i].clear();
  }
  dfs(curr_node, 1);
  ask(level[ref + 1]);
  cout << "! " << curr_node << " " << a << "\n" << flush;
  string s;
  cin >> s;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    query = 0;
    int n, x, y;
    cin >> n;
    for (int i = 0; i <= 2000; i++) {
      graph[i].clear();
      level[i].clear();
      visited[i] = 0;
    }
    for (int i = 0; i < n - 1; i++) {
      cin >> x >> y;
      graph[x].push_back(y);
      graph[y].push_back(x);
    }
    cout << "? " << n << " ";
    for (int i = 1; i <= n; i++) {
      cout << i << " ";
    }
    cout << "\n" << flush;
    cin >> x >> y;
    dfs(x, 1);
    int len = 0;
    for (int i = n; i >= 1; i--) {
      if (level[i].size() != 0) {
        len = i;
        break;
      }
    }
    bs(1, len, y);
  }
}
