#include <bits/stdc++.h>
using namespace std;
int T, N, K;
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  srand(time(NULL));
  cin >> T;
  while (T--) {
    cin >> N >> K;
    for (i = 0; i < (30); i++) {
      x = rand() % (N - 1) + 2;
      cout << "? 1 1" << endl;
      cout << 1 << endl;
      cout << x << endl;
      cin >> s;
      if (s == "SECOND") {
        cout << "! 1" << endl;
        break;
      }
    }
    if (i < 30) continue;
    int len = 1;
    while (2 * len <= N) {
      cout << "? " << len << " " << len << endl;
      for (i = 0; i < (len); i++) cout << i + 1 << " ";
      cout << endl;
      for (i = 0; i < (len); i++) cout << i + 1 + len << " ";
      cout << endl;
      cin >> s;
      if (s == "FIRST") {
        break;
      }
      assert(s == "EQUAL");
      len *= 2;
    }
    int tl = min(len, N - len);
    for (i = 9; i >= 0; i--)
      if (tl > 1 << i) {
        cout << "? " << (tl - (1 << i)) << " " << (tl - (1 << i)) << endl;
        for (j = 0; j < ((tl - (1 << i))); j++) cout << 1 + j << " ";
        cout << endl;
        for (j = 0; j < ((tl - (1 << i))); j++) cout << 1 + j + len << " ";
        cout << endl;
        cin >> s;
        if (s == "FIRST") {
          tl -= 1 << i;
        }
      }
    cout << "! " << len + tl << endl;
  }
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  cout.tie(0);
  solve();
  return 0;
}
