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