#include <bits/stdc++.h>
using namespace std;
char s[1005];
int a[1005];
inline int query(vector<int> A, vector<int> B) {
  cout << "?" << ' ' << A.size() << ' ' << B.size() << endl;
  int t = 0;
  for (int x : A) cout << x << ' ';
  puts("");
  for (int x : B) cout << x << ' ';
  puts("");
  fflush(stdout);
  scanf("%s", s);
  if (s[0] == 'E')
    return 0;
  else if (s[0] == 'F')
    return 1;
  else
    return -1;
}
inline int solve(int n, int k) {
  int T = 30;
  bool flag = 0;
  vector<int> A(1, 1), B(1);
  while (T--) {
    int x = rand() % (n - 1) + 2;
    B[0] = x;
    if (query(A, B) == -1) flag = 1;
  }
  if (flag)
    return 1;
  else {
    int i;
    for (i = 1; i << 1 <= n; i <<= 1) {
      A.clear(), B.clear();
      A.resize(i), B.resize(i);
      for (int j = 1; j <= i; ++j) A[j - 1] = j, B[j - 1] = i + j;
      if (query(A, B) == 1) {
        for (int j = i >> 1; j; j >>= 1) {
          A.clear(), B.clear(), A.resize(j), B.resize(j);
          for (int k = 1; k <= j; ++k) A[k - 1] = k, B[k - 1] = k + i;
          if (!query(A, B)) i += j;
        }
        return i + 1;
      }
    }
    for (int j = i >> 1; j; j >>= 1) {
      if (i + j > n) continue;
      A.clear(), B.clear(), A.resize(j), B.resize(j);
      for (int k = 1; k <= j; ++k) A[k - 1] = k, B[k - 1] = k + i;
      if (!query(A, B)) i += j;
    }
    return i + 1;
  }
}
int main() {
  int T, n, k;
  cin >> T;
  srand(998244353);
  while (T--) {
    cin >> n >> k;
    int mx = 0, ans = 0;
    printf("! %d\n", solve(n, k));
  }
  return 0;
}
