#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using u64 = uint64_t;
using u32 = uint32_t;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vpi = vector<pi>;
static constexpr int INF = (int)1e9 + 5;
static constexpr ll INFL = (ll)1e18 + 5;
static mt19937 rng((u32)chrono::duration_cast<chrono::nanoseconds>(
                       chrono::high_resolution_clock::now().time_since_epoch())
                       .count());
int ask(int l1, int r1, int l2, int r2) {
  cout << "? " << (r1 - l1) << ' ' << (r2 - l2) << '\n';
  for (int i = (l1); i < (r1); ++i) cout << (i + 1) << ' ';
  cout << '\n';
  for (int i = (l2); i < (r2); ++i) cout << (i + 1) << ' ';
  cout << '\n';
  string ans;
  cin >> ans;
  if (ans[0] == 'W') exit(0);
  switch (ans[0]) {
    case 'F':
      return -1;
    case 'E':
      return 0;
    default:
      return 1;
  }
}
int askSingle(int i, int j) { return ask(i, i + 1, j, j + 1); }
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    uniform_int_distribution<int> dist(1, n - 1);
    bool stone = true;
    for (int i = 0; i < (30); ++i) stone &= askSingle(0, dist(rng)) < 1;
    if (!stone) {
      cout << "! 1\n";
      continue;
    }
    int e = 0;
    while (ask(0, 1 << e, 1 << e, min(n, 2 << e)) == 0) ++e;
    int l = 1 << e, r = min(n, 2 << e);
    while (r - l > 1) {
      int m = (l + r) / 2;
      if (ask(0, m - l, l, m) == 0)
        l = m;
      else
        r = m;
    }
    cout << "! " << r << '\n';
  }
  return 0;
}
