#include <bits/stdc++.h>
using namespace std;
int get() {
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  bool flag = (c == '-');
  if (flag) c = getchar();
  int x = 0;
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return flag ? -x : x;
}
const int MAXN = 1000;
const int MAXQ = 50;
bool flag[MAXN + 1];
int lis[MAXN];
int main() {
  int test;
  cin >> test;
  while (test--) {
    int n, k;
    cin >> n >> k;
    int num = 0, s = 1;
    while (s * 2 <= n - k) {
      s *= 2;
      num++;
    }
    num = min(MAXQ - num * 2, n - 1);
    int stone = rand() % n + 1;
    memset(flag, 0, sizeof(flag));
    flag[stone] = true;
    for (int i = 0; i < num; i++) {
      int x;
      while (x = rand() % n + 1, flag[x])
        ;
      flag[x] = true;
      printf("? 1 1\n%d\n%d\n", stone, x);
      fflush(stdout);
      string s;
      cin >> s;
      if (s == "WASTED") return 0;
      if (s == "SECOND") stone = x;
    }
    lis[0] = stone;
    for (int i = 1, cur = 1; i <= n; i++)
      if (i != stone) lis[cur++] = i;
    num = 1;
    int l = -1, r = -1;
    while (l == -1) {
      string s;
      if (num * 2 > n - k)
        s = "FIRST";
      else {
        printf("? %d %d\n", num, num);
        for (int i = 0; i < num; i++)
          printf("%d%c", lis[i], (i == num - 1) ? '\n' : ' ');
        for (int i = 0; i < num; i++)
          printf("%d%c", lis[num + i], (i == num - 1) ? '\n' : ' ');
        fflush(stdout);
        cin >> s;
        if (s == "WASTED" || s == "SECOND") return 0;
      }
      if (s == "EQUAL")
        num *= 2;
      else {
        l = num;
        r = min(num * 2 - 1, n - 1);
      }
    }
    while (l < r) {
      int len = (r - l + 1) / 2;
      printf("? %d %d\n", len, len);
      for (int i = 0; i < len; i++)
        printf("%d%c", lis[i], (i == len - 1) ? '\n' : ' ');
      for (int i = 0; i < len; i++)
        printf("%d%c", lis[l + i], (i == len - 1) ? '\n' : ' ');
      fflush(stdout);
      string s;
      cin >> s;
      if (s == "WASTED" || s == "SECOND") return 0;
      if (s == "EQUAL")
        l += len;
      else
        r -= len;
    }
    printf("! %d\n", lis[l]);
    fflush(stdout);
  }
  return 0;
}
