func_code_string: #include <bits/stdc++.h>   using namespace std;   template <typename Arg1>   void __f(const char* name, Arg1&& arg1) {     cout << name <<   :   << arg1 <<   n ;   }   template <typename Arg1, typename... Args>   void __f(const char* names, Arg1&& arg1, Args&&... args) {     const char* comma = strchr(names + 1,  , );     cout.write(names, comma - names) <<   :   << arg1 <<   ,  ;     __f(comma + 1, args...);   }   const int N = 1e3 + 10;   vector<vector<int>> g;   vector<int> par, height;   int n;   int bfs(int root) {     int last = root;     par[root] = -1;     height[root] = 0;     queue<int> q;     q.push(root);     while (!q.empty()) {       int u = q.front();       q.pop();       last = u;       for (auto v : g[u])         if (v != par[u]) {           par[v] = u;           height[v] = height[u] + 1;           q.push(v);         }     }     return last;   }   void dfs(int u, int par, int tar) {     for (int v : g[u])       if (v != par) {         if (v == tar) {           g[u].erase(find(g[u].begin(), g[u].end(), v));           g[v].erase(find(g[v].begin(), g[v].end(), u));         } else           dfs(v, u, tar);       }   }   int main() {     int i, j, k, n, m;     cin >> n;     g.resize(n);     par.resize(n);     height.resize(n);     for (i = 0; i < n - 1; ++i) {       int u, v;       cin >> u >> v;       u--, v--;       g[u].push_back(v);       g[v].push_back(u);     }     int x, y, q;     x = bfs(0);     y = bfs(x);     cout <<  ?   << x + 1 <<     << y + 1 << endl;     cin >> q;     q--;     while (1) {       dfs(x, -1, q);       dfs(y, -1, q);       if (g[q].size() == 0) {         cout <<  !   << q + 1 << endl;         return 0;       };       x = bfs(q);       y = bfs(x);       cout <<  ?   << x + 1 <<     << y + 1 << endl;       cin >> q;       q--;     }     return 0;   }   