#include <bits/stdc++.h>   using namespace std;   int L = 2e5;   vector<vector<int>> g(L);   vector<int> dp(L), d(L, 0), par(L, -1);   vector<bool> used(L);   int dist;   int ask1(int u) {     cout <<  d   << u + 1 << endl;     int t;     cin >> t;     if (t == -1) {       while (true) {       }     }     return t;   }   int ask2(int u) {     cout <<  s   << u + 1 << endl;     int t;     cin >> t;     --t;     if (t == -1) {       while (true) {       }     }     return t;   }   void dfs(int u) {     used[u] = true;     for (auto v : g[u]) {       if (!used[v]) {         d[v] = d[u] + 1;         par[v] = u;         dfs(v);         dp[u] += dp[v];       }     }     if (d[u] == dist) dp[u]++;   }   int main() {     int n;     cin >> n;     for (int i = 0; i < n - 1; i++) {       int u, v;       cin >> u >> v;       --u;       --v;       g[u].push_back(v);       g[v].push_back(u);     }     dist = ask1(0);     dfs(0);     int q = 0;     if (dist == 0) {       cout <<  ! 1  << endl;       return 0;     } else {       while (d[q] != dist) {         int r = q;         while (d[r] != dist) {           int t = -1;           int ma = 0;           for (auto v : g[r]) {             if (d[v] > d[r]) {               if (dp[v] > ma) {                 ma = dp[v];                 t = v;               }             }           }           r = t;         }         int newdist = ask1(r);         if (newdist == 0) {           cout <<  !   << r + 1 << endl;           return 0;         } else {           while (d[r] * 2 != 2 * dist - newdist) {             r = par[r];           }           q = ask2(r);         }       }       cout <<  !   << q + 1 << endl;       return 0;     }     cin >> n;   }   