#include <bits/stdc++.h>   using namespace std;   int n, cnt, T;   vector<int> g[128];   void input(int x) {     if (g[x].size()) return;     if (cnt == 16) {       g[x].push_back(1), g[x].push_back(1);       return;     }     cnt++;     printf( ? %d n , x);     fflush(stdout);     int nw, y;     scanf( %d , &nw);     while (nw--) {       scanf( %d , &y);       g[x].push_back(y);     }     return;   }   void solve() {     cnt = 0;     for (int i = 0; i < 128; i++) g[i].clear();     cin >> n;     input(1);     if (g[1].size() == 2) {       printf( ! 1 n );       fflush(stdout);       return;     }     deque<int> q;     q.push_back(1);     int nw = 1;     while (g[nw].size() != 1) {       for (int i = 0; i < g[nw].size(); i++)         if (g[g[nw][i]].size() == 0) {           nw = g[nw][i];           break;         }       q.push_front(nw);       input(nw);       if (g[nw].size() == 2) {         cout <<  !   << nw << endl;         fflush(stdout);         return;       }     }     nw = 1;     while (g[nw].size() != 1) {       for (int i = 0; i < g[nw].size(); i++)         if (g[g[nw][i]].size() == 0) {           nw = g[nw][i];           break;         }       q.push_back(nw);       input(nw);       if (g[nw].size() == 2) {         cout <<  !   << nw << endl;         fflush(stdout);         return;       }     }     nw = q[q.size() / 2];     int dep = q.size() / 2;     vector<int> pa;     if (q.size() != 1) {       pa.push_back(q[q.size() / 2 - 1]);       pa.push_back(q[q.size() / 2 + 1]);     }     int couter = 0;     while (dep != n - 3 && dep != n - 1) {       vector<int> maybe;       input(nw);       if (g[nw].size() == 2) {         cout <<  !   << nw << endl;         fflush(stdout);         return;       }       for (int i = 0; i < g[nw].size(); i++) {         bool ok = 1;         for (int j = 0; j < pa.size(); j++)           if (pa[j] == g[nw][i]) ok = 0;         if (ok) maybe.push_back(g[nw][i]);       }       dep++;       pa.clear();       couter = couter * 10 + maybe.size();       if (maybe.size() == 1) {         pa.push_back(nw);         nw = maybe[0];         continue;       }       int nwchk = maybe[0];       for (int i = 0; i < dep - 2; i++) {         input(nwchk);         if (g[nwchk].size() == 2) {           cout <<  !   << nwchk << endl;           fflush(stdout);           return;         }         for (int j = 0; j < g[nwchk].size(); j++)           if (g[g[nwchk][j]].size() == 0) nwchk = g[nwchk][j];       }       input(nwchk);       if (g[nwchk].size() == 2) {         cout <<  !   << nwchk << endl;         fflush(stdout);         return;       }       pa.push_back(nw);       if (g[nwchk].size() == 1)         nw = maybe[1];       else         nw = maybe[0];     }     if (dep == n - 1) {       cout <<  !   << nw << endl;       fflush(stdout);       return;     }     input(nw);     vector<int> maybe;     for (int i = 0; i < g[nw].size(); i++) {       maybe.push_back(g[nw][i]);       input(g[nw][i]);       if (g[g[nw][i]].size() == 2) {         cout <<  !   << g[nw][i] << endl;         fflush(stdout);         return;       }     }     for (int i = 0; i < maybe.size(); i++)       for (int j = 0; j < g[maybe[i]].size(); j++) {         input(g[maybe[i]][j]);         if (g[g[maybe[i]][j]].size() == 2) {           cout <<  !   << g[maybe[i]][j] << endl;           fflush(stdout);           return;         }       }     if (T == 7) {       cout <<  !   << couter;       fflush(stdout);       exit(0);     }     cout <<  ! -1 n ;     fflush(stdout);     return;   }   int main() {     cin >> T;     while (T--) solve();   }   