#include <bits/stdc++.h>
using namespace std;

const int N = 2010;

int ask(int l1,int r1,int l2,int r2){
   printf("? %d %d\n",r1 - l1 + 1 , r2 - l2 + 1);
   fflush(stdout);
   for(int i = l1;i <= r1;i++){
    if(i > l1) putchar(' ');
    printf("%d",i);
   }
   puts("");
   fflush(stdout);
   for(int i = l2;i <= r2;i++){
    if(i > l2) putchar(' ');
    printf("%d",i);
   }
   puts("");
   fflush(stdout);
   int res;
   scanf("%d",&res);
   return res;
}

int ans[N] , n;

void solve(){
    scanf("%d",&n);
    int idx = 2;
    while(true){
        if(ask(1 , idx - 1 , idx , idx) != 0)
            break;
        idx++;
    }
    int low = 1, high = idx - 1 , res = idx - 1, mid;
    while(high >= low){
        mid = (low + high) / 2;
        if(ask(1 , mid , idx , idx) != 0)
            res = mid , high = mid - 1;
        else
            low = mid + 1;
    }
    for(int i = 0 ;i < idx;i++){
        if(i != res)
            ans[i] = 0;
        else
            ans[i] = -1;
    }
    ans[idx] = -1;
    for(int i = idx + 1;i <= n;i++){
        if(ask(idx , idx , i , i) == 0)
            ans[i] = 0;
        else
            ans[i] = -1;
    }
    vector< int > v;
    for(int i = 1;i <= n;i++){
        if(ans[i] == 0)
            v.push_back(i);
    }
    printf("! %d",(int)v.size());
    for(int i = 0 ;i < (int)v.size();i++){
        printf(" %d",v[i]);
    }
    puts("");
    fflush(stdout);
}


int main(){
    int t;
    cin >> t;
    while(t--){
        solve();
    }
    return 0;
}
