#include <bits/stdc++.h>
using namespace std;
int T, n, k;
char str[10];
char ask(int l1, int r1, int l2, int r2) {
  int k1 = r1 - l1 + 1, k2 = r2 - l2 + 1;
  printf("? %d %d\n", k1, k2);
  for (int i = l1; i <= r1; i++) printf("%d ", i);
  puts("");
  for (int i = l2; i <= r2; i++) printf("%d ", i);
  puts("");
  fflush(stdout);
  scanf("%s", str);
  return str[0];
}
void work() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= 30; i++) {
    int x = rand() % (n - 1) + 2;
    char op = ask(1, 1, x, x);
    if (op == 'S') return (void)(puts("! 1"));
  }
  int st = 1;
  for (; (st << 1) <= n; st <<= 1) {
    char op = ask(1, st, st + 1, st << 1);
    if (op != 'E') break;
  }
  int l = st + 1, r = min(st << 1, n);
  while (l < r) {
    int mid = (l + r) >> 1;
    if (ask(1, mid - l + 1, l, mid) == 'E')
      l = mid + 1;
    else
      r = mid;
  }
  printf("! %d\n", l);
}
int main() {
  srand(19260817);
  scanf("%d", &T);
  while (T--) {
    work();
    fflush(stdout);
  }
  return 0;
}
