#include <bits/stdc++.h>
using namespace std;
int n, m;
int T, k;
char a[10];
int ask(int l, int r, int L, int R) {
  int i;
  printf("? %d %d\n", r - l + 1, R - L + 1);
  for (i = l; i <= r; i++) printf("%d ", i);
  printf("\n");
  for (i = L; i <= R; i++) printf("%d ", i);
  printf("\n");
  fflush(stdout);
  scanf("%s", a);
  if (a[0] == 'F')
    return 1;
  else if (a[0] == 'S')
    return 2;
  else if (a[0] == 'E')
    return 3;
  else
    return 4;
}
int main() {
  int i, j, x;
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d", &n, &k);
    srand(time(0));
    x = rand() % (n - 1) + 2;
    int flag = 0;
    for (i = 1; i <= 30; i++) {
      int ans = ask(1, 1, x, x);
      if (ans == 2) {
        printf("! 1\n");
        flag = 1;
        break;
      }
      x = rand() % (n - 1) + 2;
    }
    if (!flag) {
      int l, r;
      for (x = 1; x * 2 <= n; x *= 2) {
        if (ask(1, x, x + 1, x * 2) ^ 3) {
          break;
        }
      }
      l = x + 1, r = min(x * 2, n);
      while (l < r) {
        int mid = (l + r) >> 1;
        if (ask(l, mid, 1, mid - l + 1) == 3)
          l = mid + 1;
        else
          r = mid;
      }
      printf("! %d\n", l);
    }
    fflush(stdout);
  }
  return 0;
}
