#include <bits/stdc++.h>
using namespace std;
int order[1001];
char check(int start1, int last1, int start2, int last2) {
  cout << "? " << last1 - start1 + 1 << " " << last2 - start2 + 1 << endl;
  for (int i = start1; i <= last1; ++i) cout << i << " ";
  cout << endl;
  for (int i = start2; i <= last2; ++i) cout << i << " ";
  cout << endl;
  cout.flush();
  string s;
  cin >> s;
  return s[0];
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    int minjewel = n + 1;
    if (n <= 51) {
      for (int i = 0; i < n - 1; ++i) {
        char c = check(1, 1, i + 2, i + 2);
        if (c == 'S') minjewel = 0;
        if (c == 'F') minjewel = min(minjewel, i + 1);
      }
      cout << "! " << minjewel + 1 << endl;
      cout.flush();
      continue;
    }
    for (int i = 0; i < n; ++i) order[i] = i;
    random_shuffle(order + 1, order + n);
    sort(order + 20, order + n);
    for (int i = 1; i <= 20; ++i) {
      int next = rand() % (n - 1) + 1;
      char c = check(1, 1, next + 1, next + 1);
      if (c == 'S') minjewel = 0;
      if (c == 'F') minjewel = min(minjewel, next);
    }
    if (minjewel == 0) {
      cout << "! 1" << endl;
      cout.flush();
      continue;
    }
    int cntstone = 1;
    int first_cand = n;
    int last_cand = n;
    while (cntstone * 2 <= n) {
      char c = check(1, cntstone, cntstone + 1, cntstone * 2);
      if (c == 'E') {
        cntstone *= 2;
        continue;
      }
      if (c == 'F') {
        first_cand = cntstone;
        last_cand = cntstone * 2 - 1;
        break;
      }
    }
    if (first_cand == n) first_cand = cntstone, last_cand = n - 1;
    while (last_cand > first_cand) {
      int mid_cand = (first_cand + last_cand) / 2;
      char c =
          check(1, mid_cand - first_cand + 1, first_cand + 1, mid_cand + 1);
      if (c == 'E')
        first_cand = mid_cand + 1;
      else
        last_cand = mid_cand;
    }
    cout << "! " << first_cand + 1 << endl;
    cout.flush();
  }
  return 0;
}
