#include <bits/stdc++.h>
#pragma GCC optimize(2)
const double esp = 1e-6;
const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int inf = 1e9;
using namespace std;
long long read() {
  char ch = getchar();
  long long x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int T, n, k;
char s[100];
int main() {
  srand((int)time(0));
  T = read();
  while (T--) {
    n = read(), k = read();
    bool flag = 0;
    for (int i = 1; i <= 30; i++) {
      int pos = 0;
      while (!pos) pos = rand() % n;
      printf("? 1 1\n");
      printf("1\n%d\n", pos + 1);
      fflush(stdout);
      scanf("%s", s);
      if (s[0] == 'F' || s[0] == 'E') {
        continue;
      } else {
        flag = 1;
        break;
      }
    }
    if (flag) {
      printf("! 1\n");
      fflush(stdout);
    } else {
      int pos = 1;
      for (int i = 1; i * 2 <= n; (i <<= 1), (pos <<= 1)) {
        printf("? %d %d\n", i, i);
        for (int j = 1; j <= i; j++) cout << j << " ";
        cout << endl;
        for (int j = 1; j <= i; j++) cout << i + j << " ";
        cout << endl;
        fflush(stdout);
        scanf("%s", s);
        if (s[0] == 'F') {
          break;
        }
      }
      int lf = pos;
      int rt = min(n + 1, pos * 2 + 1);
      while (rt - lf > 1) {
        int mid = (rt + lf) >> 1;
        int len = mid - lf;
        printf("? %d %d\n", len, len);
        for (int i = 1; i <= len; i++) cout << i << " ";
        cout << endl;
        for (int i = lf + 1; i <= mid; i++) cout << i << " ";
        cout << endl;
        fflush(stdout);
        scanf("%s", s);
        if (s[0] == 'F') {
          rt = mid;
        } else {
          lf = mid;
        }
      }
      printf("! %d\n", rt);
      fflush(stdout);
    }
  }
  return 0;
}
