#include <bits/stdc++.h>
char s[15];
int getAnswer(int l, int r) {
  int res = -1;
  while (l <= r) {
    int m = (l + r) / 2;
    printf("? %d %d\n", m - l + 1, m - l + 1);
    for (int i = 1; i <= m - l + 1; i++) printf("%d ", i);
    printf("\n");
    for (int i = l; i <= m; i++) printf("%d ", i);
    printf("\n");
    fflush(stdout);
    scanf("%s", s + 1);
    if (s[1] == 'F') {
      res = m;
      r = m - 1;
    } else
      l = m + 1;
  }
  return res;
}
int main() {
  srand(time(NULL));
  int T;
  scanf("%d", &T);
  while (T--) {
    int n, k;
    scanf("%d%d", &n, &k);
    int find = 0;
    for (int i = 0; i < 29; i++) {
      int v = rand() % (n - 1) + 2;
      printf("? 1 1\n1\n%d\n", v);
      fflush(stdout);
      scanf("%s", s + 1);
      if (s[1] == 'S') find = 1;
    }
    if (find)
      printf("! 1\n");
    else {
      int base = 1;
      while ((2 * base) <= n) {
        printf("? %d %d\n", base, base);
        for (int i = 1; i <= base; i++) printf("%d ", i);
        printf("\n");
        for (int i = base + 1; i <= 2 * base; i++) printf("%d ", i);
        printf("\n");
        fflush(stdout);
        scanf("%s", s + 1);
        if (s[1] == 'F') {
          find = 1;
          break;
        } else
          base *= 2;
      }
      if (find)
        printf("! %d\n", getAnswer(base + 1, 2 * base));
      else
        printf("! %d\n", getAnswer(base + 1, n));
    }
    fflush(stdout);
  }
  return 0;
}
