#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int my_random(int n) {
  int x = rng();
  x %= n;
  x += n;
  x %= n;
  return x + 1;
}
int heavy(int a, int b) {
  if (a == b) return a;
  cout << "? 1 1" << endl;
  cout << a << endl;
  cout << b << endl;
  string s;
  cin >> s;
  if (s == "FIRST") return a;
  return b;
}
int heavy(vector<int> &a, vector<int> &b) {
  set<int> s;
  for (int x : a) s.insert(x);
  for (int x : b) s.insert(x);
  assert(s.size() == a.size() + b.size());
  cout << "? " << a.size() << " " << b.size() << endl;
  for (int x : a) cout << x << " ";
  cout << endl;
  for (int x : b) cout << x << " ";
  cout << endl;
  string ss;
  cin >> ss;
  if (ss == "EQUAL") return 0;
  if (ss == "FIRST") return 1;
  return -1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int tc;
  cin >> tc;
  while (tc--) {
    int n, K;
    cin >> n >> K;
    int mx_idx = my_random(n);
    for (int itr = 1; itr <= 25; itr++) {
      mx_idx = heavy(mx_idx, my_random(n));
    }
    vector<int> rem_idx;
    for (int i = 1; i <= n; i++) {
      if (i != mx_idx) rem_idx.push_back(i);
    }
    vector<int> L, R;
    for (int k = 1;; k *= 2) {
      vector<int> lft, rgt;
      lft.push_back(mx_idx);
      for (int i = 1; i < k; i++) lft.push_back(rem_idx[i - 1]);
      for (int i = k; i < min(n, k + k); i++) rgt.push_back(rem_idx[i - 1]);
      if (heavy(lft, rgt) == 0) {
        continue;
      }
      L = lft, R = rgt;
      break;
    }
    int lo = 0, hi = (int)R.size() - 1;
    while (hi > lo) {
      int mid = hi + lo >> 1;
      vector<int> aa, bb;
      for (int i = 0; i <= mid; i++) {
        aa.push_back(L[i]);
        bb.push_back(R[i]);
      }
      if (heavy(aa, bb) == 0)
        lo = mid + 1;
      else
        hi = mid;
    }
    cout << "! " << R[lo] << endl;
  }
  return 0;
}
