#include <bits/stdc++.h>
using namespace std;
int ask(vector<int> a, vector<int> b) {
  cout << "? " << a.size() << ' ' << b.size() << '\n';
  for (int i : a) cout << i + 1 << ' ';
  cout << '\n';
  for (int i : b) cout << i + 1 << ' ';
  cout << endl;
  string s;
  cin >> s;
  if (s == "FIRST") return -1;
  if (s == "SECOND") return 1;
  if (s == "EQUAL") return 0;
  exit(0);
}
void solve() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < 10; ++i) {
    int ii = rand() % n;
    if (!ii) ii++;
    int e = ask({0}, {ii});
    if (e == 1) {
      cout << "! " << 1 << endl;
      return;
    }
  }
  int fo;
  for (fo = 0; fo < 11; ++fo) {
    vector<int> a, b;
    for (int i = 0; i < min(n / 2, (1 << fo)); ++i) a.push_back(i);
    for (int i = a.back() + 1; i < min(n - n % 2, (2 << fo)); ++i)
      b.push_back(i);
    int e = ask(a, b);
    if (e == -1) break;
  }
  if (fo == 11) {
    cout << "! " << n << endl;
    return;
  }
  int xl = min(n / 2 + 1, (1 << fo));
  int l = xl - 1, r = min(n, (2 << fo));
  while (r - l > 1) {
    int md = r + l >> 1;
    vector<int> a, b;
    for (int i = 0; i <= md - xl; ++i) a.push_back(i);
    for (int i = xl; i <= md; ++i) b.push_back(i);
    int e = ask(a, b);
    if (e == 0)
      l = md;
    else
      r = md;
  }
  cout << "! " << r + 1 << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  cin >> t;
  while (t--) solve();
}
