#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> h;
vector<bool> B;
vector<vector<int>> e;
void A(int num, int d) {
  B[num] = 1;
  h[d].push_back(num);
  for (int i = 0; i < e[num].size(); i++) {
    if (B[e[num][i]] == 0) A(e[num][i], d + 1);
  }
}
vector<int> z;
void C(int num, int d, int r) {
  B[num] = 1;
  if (d == r) z.push_back(num);
  for (int i = 0; i < e[num].size(); i++) {
    if (B[e[num][i]] == 0) C(e[num][i], d + 1, r);
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    z.clear();
    int n, u, v, d, num, q, w, a1, a2, y = 0;
    cin >> n;
    h.clear();
    B.clear();
    e.clear();
    vector<int> b;
    h.resize(n, b);
    B.resize(n, 0);
    e.resize(n, b);
    for (int i = 0; i < n - 1; i++) {
      cin >> q >> w;
      q--;
      w--;
      for (int i = 0; i < e[q].size(); i++) {
        if (e[q][i] == w) {
          y = 1;
        }
      }
      if (y == 0) {
        e[q].push_back(w);
        e[w].push_back(q);
      }
    }
    cout << "? " << n << " ";
    for (int i = 1; i <= n; i++) {
      cout << i << " ";
    }
    cout << endl;
    cout.flush();
    cin >> num >> d;
    num--;
    int l, r, m;
    l = d / 2;
    A(num, 0);
    for (int j = h.size() - 1; j >= 0; j--) {
      if (h[j].size() != 0) {
        h.resize(j + 1);
        break;
      }
    }
    r = h.size();
    int f, p;
    while (l + 1 < r) {
      cout << "? ";
      m = (l + r) / 2;
      cout << h[m].size() << " ";
      for (int j = 0; j < h[m].size(); j++) {
        cout << h[m][j] + 1 << " ";
      }
      cout << endl;
      cout.flush();
      cin >> f >> p;
      f--;
      if (p > d) {
        r = m;
      } else
        l = m;
    }
    cout << "? " << h[l].size() << " ";
    for (int j = 0; j < h[l].size(); j++) {
      cout << h[l][j] + 1 << " ";
    }
    cout << endl;
    cout.flush();
    cin >> a1 >> p;
    a1--;
    B.clear();
    B.resize(n, 0);
    C(a1, 0, d);
    cout << "? " << z.size() << " ";
    for (int j = 0; j < z.size(); j++) {
      cout << z[j] + 1 << " ";
    }
    cout << endl;
    cout.flush();
    cin >> a2 >> p;
    cout << "! " << a1 + 1 << " " << a2;
    cout << endl;
    cout.flush();
    string W;
    cin >> W;
    if (W == "Incorrect") return 0;
  }
  return 0;
}
