#include <bits/stdc++.h>
using namespace std;
const long long int mod1 = 1000000007;
const long long int mod2 = 998244353;
long long int gcd(long long int a, long long int b) {
  long long int c;
  while (b) {
    c = b;
    b = a % b;
    a = c;
  }
  return a;
}
long long int lcm(long long int a, long long int b) {
  return (a / gcd(a, b) * b);
}
long long int power(long long int a, long long int b, long long int m = 0) {
  if (m == 0) {
    long long int out = 1;
    while (b) {
      if (b & 1) {
        out *= a;
      }
      b >>= 1;
      a *= a;
    }
    return out;
  } else {
    a %= m;
    long long int out = 1;
    while (b) {
      if (b & 1) {
        out *= a;
        out %= m;
      }
      b >>= 1;
      a = (a * a) % m;
    }
    return out;
  }
}
long long int modi(long long int x, long long int p) {
  return power(x, p - 2, p);
}
vector<long long int> g[1005];
long long int par[1005];
long long int siz[1005];
vector<long long int> dep[1005];
vector<long long int> interact;
pair<long long int, long long int> query(long long int qw) {
  cout << "? " << dep[qw].size() << " ";
  for (auto x : dep[qw]) {
    cout << x << " ";
  }
  cout << endl;
  long long int x, d;
  cin >> x >> d;
  return {x, d};
}
pair<long long int, long long int> query1(vector<long long int> v) {
  cout << "? " << v.size() << " ";
  for (auto x : v) {
    cout << x << " ";
  }
  cout << endl;
  long long int x, d;
  cin >> x >> d;
  return {x, d};
}
void dfs(long long int x, long long int p, long long int lev) {
  par[x] = p;
  long long int su = 1;
  dep[lev].push_back(x);
  for (auto q : g[x]) {
    if (q != p) {
      dfs(q, x, lev + 1);
      su++;
    }
  }
  siz[x] = su;
}
long long int mag;
long long int tot = 0;
long long int bin(long long int l, long long int r) {
  if (tot >= 14) {
    while (true) {
    }
  }
  if (r == l) {
    pair<long long int, long long int> xy = query(l);
    tot++;
    return xy.first;
  } else if (r == l + 1) {
    pair<long long int, long long int> qwr = query(l);
    tot++;
    if (tot >= 14) {
      while (true) {
      }
    }
    if (qwr.second != mag) {
      return bin(r, r);
    } else {
      pair<long long int, long long int> fg = query(r);
      tot++;
      if (fg.second == mag) {
        return fg.first;
      } else {
        return qwr.first;
      }
    }
  } else {
    long long int mid = (l + r) / 2;
    tot++;
    pair<long long int, long long int> xy = query(mid);
    if (xy.second == mag) {
      return bin(mid, r);
    } else {
      return bin(l, mid - 1);
    }
  }
}
void dfs2(long long int x, long long int p, long long int dis) {
  if (dis == mag) {
    interact.push_back(x);
  }
  for (auto q : g[x]) {
    if (q != p) {
      dfs2(q, x, dis + 1);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int tt = 1;
  cin >> tt;
  while (tt--) {
    for (int i = 0; i <= 1004; i++) {
      g[i].clear();
      dep[i].clear();
    }
    interact.clear();
    long long int n;
    cin >> n;
    for (int i = 0; i < n - 1; i++) {
      long long int x, y;
      cin >> x >> y;
      g[x].push_back(y);
      g[y].push_back(x);
    }
    interact.clear();
    for (int i = 1; i <= n; i++) {
      interact.push_back(i);
    }
    pair<long long int, long long int> out = query1(interact);
    dfs(out.first, -1, 0);
    long long int mind = out.second;
    mag = mind;
    long long int max_dep = 0;
    for (int i = 0; i < n; i++) {
      if (dep[i].size()) {
        max_dep = i;
      }
    }
    tot = 0;
    long long int cur = bin(0, max_dep);
    interact.clear();
    dfs2(cur, -1, 0);
    pair<long long int, long long int> fin = query1(interact);
    cout << "! " << cur << " " << fin.first << endl;
    string s;
    cin >> s;
  }
}
