#include <bits/stdc++.h>
const int INF = std::numeric_limits<int>::max() / 2;
const long long INFLL = std::numeric_limits<long long>::max() / 2;
namespace libcp {
std::mt19937 generator(
    std::chrono::steady_clock::now().time_since_epoch().count());
uint64_t rand() {
  return std::uniform_int_distribution<uint64_t>(
      0, std::numeric_limits<uint64_t>::max())(generator);
}
uint64_t rand(const uint64_t hi) {
  return std::uniform_int_distribution<uint64_t>(0, hi)(generator);
}
uint64_t rand(const uint64_t lo, const uint64_t hi) {
  return std::uniform_int_distribution<uint64_t>(lo, hi)(generator);
}
}  // namespace libcp
int t, n, k;
std::vector<int> a, b;
std::string s;
void query() {
  assert(!a.empty() && !b.empty());
  std::cout << "? " << a.size() << ' ' << b.size() << '\n';
  for (int i : a) std::cout << i << ' ';
  std::cout << '\n';
  for (int i : b) std::cout << i << ' ';
  std::cout << std::endl;
  a.clear();
  b.clear();
  std::cin >> s;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  std::cin >> t;
  while (t--) {
    std::cin >> n >> t;
    int cnt = 1, lo = 2, hi = n;
    for (int i = 0; i < 30; ++i) {
      a.push_back(1);
      b.push_back(libcp::rand(2, n));
      query();
      if (s == "SECOND") {
        std::cout << "! 1" << std::endl;
        goto done;
      }
    }
    while (cnt * 2 < hi - lo + 1) {
      int k = std::min(cnt, hi - lo + 1);
      for (int i = 1; i <= k; ++i) a.push_back(i);
      for (int i = lo; i <= lo + k - 1; ++i) b.push_back(i);
      query();
      if (s == "EQUAL") {
        cnt += k;
        lo += k;
      } else
        hi = lo + k - 1;
    }
    while (lo < hi) {
      int m = (lo + hi) / 2, k = m - lo + 1;
      for (int i = 1; i <= k; ++i) a.push_back(i);
      for (int i = lo; i <= m; ++i) b.push_back(i);
      query();
      if (s == "EQUAL")
        lo = m + 1;
      else
        hi = m;
    }
    std::cout << "! " << lo << std::endl;
  done:
    continue;
  }
  return 0;
}
