func_code_string: #include <bits/stdc++.h>   using namespace std;   template <class S, class T>   ostream& operator<<(ostream& o, const pair<S, T>& p) {     return o <<  (  << p.first <<  ,  << p.second <<  ) ;   }   template <class T>   ostream& operator<<(ostream& o, const vector<T>& vc) {     o <<  sz =   << vc.size() << endl <<  [ ;     for (const T& v : vc) o << v <<  , ;     o <<  ] ;     return o;   }   int cnt;   vector<int> ask(int v) {     cout <<  ?   << v << endl;     int K;     cin >> K;     vector<int> ret;     for (int i = 0; i < (int)(K); i++) {       int x;       cin >> x;       ret.push_back(x);     }     cnt++;     assert(cnt <= 16);     return ret;   }   void ans(int v) { cout <<  !   << v << endl; }   bool ToLeaf(int v, int p, vector<int>& vs, vector<vector<int> >& vis) {     while (true) {       vector<int> vi = ask(v);       if (vi.size() == 2) {         ans(v);         return 1;       }       vs.push_back(v);       vis.push_back(vi);       if (vi.size() == 1) break;       int nv = -1;       for (int i = 0; i < (int)(3); i++)         if (vi[i] != p) nv = vi[i];       p = v, v = nv;     }     return 0;   }   bool Leaf2Leaf(vector<int>& vs, vector<vector<int> >& vis) {     int s = 1;     if (ToLeaf(s, -1, vs, vis)) return 1;     if (vs.size() == 1) return 0;     int nxt = -1;     for (int nv : vis[0])       if (nv != vs[1]) nxt = nv;     reverse(vs.begin(), vs.end());     reverse(vis.begin(), vis.end());     if (ToLeaf(nxt, s, vs, vis)) return 1;     return 0;   }   bool dfs(int v, int p, int d = 0) {     vector<int> vi = ask(v);     if (vi.size() == 2) {       ans(v);       return 1;     }     if (d == 2) {       return 0;     }     for (int u : vi)       if (u != p) {         if (cnt < 16) {           if (dfs(u, v, d + 1)) return 1;         } else {           ans(u);           return 1;         }       }     return 0;   }   void solve() {     cnt = 0;     int H;     cin >> H;     vector<int> vs;     vector<vector<int> > vis;     if (Leaf2Leaf(vs, vis)) {       return;     }     int K = vs.size();     while (K <= 5) {       int top = vs[K / 2];       int nxt = -1;       if (vis[K / 2].size() == 1)         nxt = vis[K / 2][0];       else         nxt = vis[K / 2][0] ^ vis[K / 2][1] ^ vis[K / 2][2] ^ vs[K / 2 - 1] ^               vs[K / 2 + 1];       for (int i = 0; i < (int)(K / 2); i++) vs.pop_back(), vis.pop_back();       if (ToLeaf(nxt, top, vs, vis)) {         return;       }       K = vs.size();     }     int top = vs[K / 2];     int nxt = vis[K / 2][0] ^ vis[K / 2][1] ^ vis[K / 2][2] ^ vs[K / 2 - 1] ^               vs[K / 2 + 1];     assert(dfs(nxt, top));   }   int main() {     int T;     cin >> T;     for (int t = 0; t < (int)(T); t++) solve();   }   