#include <bits/stdc++.h>
using namespace std;
int T, n, k;
char s[10];
int chk(int l1, int r1, int l2, int r2) {
  printf("? %d %d\n", r1 - l1 + 1, r2 - l2 + 1);
  for (int i = l1; i <= r1; i++) printf("%d ", i);
  putchar('\n');
  for (int i = l2; i <= r2; i++) printf("%d ", i);
  putchar('\n');
  fflush(stdout);
  scanf("%s", &s);
  if (s[0] == 'F') return 1;
  if (s[0] == 'S') return -1;
  if (s[0] == 'E') return 0;
}
int main() {
  srand(time(NULL));
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d", &n, &k);
    bool pd = 0;
    for (int i = 1; i <= 25; i++) {
      int x = 1ll * rand() * rand() % (n - 1) + 2;
      if (chk(1, 1, x, x) == -1) {
        pd = 1;
        break;
      }
    }
    if (pd) {
      puts("! 1");
      fflush(stdout);
      continue;
    }
    int l, r, ans = -1;
    for (int mid = 1; mid < n; mid <<= 1) {
      if (chk(1, mid, mid + 1, min(2 * mid, n)) == 1) {
        l = mid + 1, r = min(2 * mid, n);
        break;
      }
    }
    while (l <= r) {
      int mid = l + r >> 1;
      if (chk(1, mid - l + 1, l, mid) == 0)
        l = mid + 1;
      else
        ans = mid, r = mid - 1;
    }
    printf("! %d\n", ans), fflush(stdout);
  }
}
