#include <bits/stdc++.h>
using namespace std;
void solve2(int x, int y, int n) {
  int lt = x, rt = y, mid;
  int ans = y;
  while (lt <= rt) {
    mid = (lt + rt) >> 1;
    cout << "? " << mid - x + 1 << " " << mid - x + 1 << endl;
    for (int j = 1; j <= mid - x + 1; j++) cout << j << " ";
    cout << endl;
    for (int j = x; j <= mid; j++) cout << j << " ";
    cout << endl;
    fflush(stdout);
    char s[10];
    cin >> s;
    if (s[0] != 'E')
      ans = mid, rt = mid - 1;
    else
      lt = mid + 1;
  }
  cout << "! " << ans << endl;
  fflush(stdout);
}
void solve() {
  int n, m;
  char s[10];
  cin >> n >> m;
  for (int i = 1; i <= 30; i++) {
    int x = rand() % (n - 1) + 2;
    cout << "? 1 " << 1 << endl;
    cout << 1 << endl << x << endl;
    fflush(stdout);
    cin >> s;
    if (s[0] == 'S') {
      cout << "! " << 1 << endl;
      fflush(stdout);
      return;
    }
  }
  for (int i = 0;; i++) {
    int st1 = 1;
    int ed1 = (1 << i);
    int st2 = ed1 + 1;
    int ed2 = st2 + (1 << i) - 1;
    if (ed2 <= n) {
      cout << "? " << (1 << i) << " " << (1 << i) << endl;
      for (int j = st1; j <= ed1; j++) cout << j << " ";
      cout << endl;
      for (int j = st2; j <= ed2; j++) cout << j << " ";
      cout << endl;
      fflush(stdout);
      cin >> s;
      if (s[0] == 'E') continue;
      if (s[0] == 'F') {
        solve2(st2, ed2, n);
        return;
      }
    } else {
      solve2(st2, n, n);
      return;
    }
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
