#include <bits/stdc++.h>
using namespace std;
const long long INF = 2e16;
const long long MB = 20;
const long long MOD = 2019;
long long check(long long l1, long long r1, long long l2, long long r2) {
  cout << "? " << r1 - l1 + 1 << " " << r2 - l2 + 1 << '\n';
  for (long long i = l1; i <= r1; i++) cout << i << " ";
  cout << '\n';
  for (long long i = l2; i <= r2; i++) cout << i << " ";
  cout << endl;
  string s;
  cin >> s;
  assert(s != "WASTED");
  if (s == "FIRST") return 0;
  if (s == "EQUAL") return 1;
  return 2;
}
void solve() {
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < 30; i++) {
    long long r = rand() % (n - 1) + 2;
    long long x = check(1, 1, r, r);
    if (x == 2) {
      cout << "! 1" << endl;
      return;
    }
  }
  long long q = 0;
  while ((1 << (q + 1)) <= n) {
    if (check(1, (1 << q), (1 << q) + 1, (1 << (q + 1))) != 1) break;
    q++;
  }
  long long left = (1 << q) + 1;
  long long l = (1 << q);
  long long r = min(n + 1, 1LL << (q + 1));
  while (r - l > 1) {
    long long m = (l + r) >> 1;
    if (check(1, m - left + 1, left, m) != 1)
      r = m;
    else
      l = m;
  }
  cout << "! " << r << endl;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed;
  cout.precision(12);
  long long t;
  cin >> t;
  while (t--) solve();
}
