func_code_string: #include <bits/stdc++.h>   using ii = std::pair<int, int>;   bool visited[50001];   int nexts[50001];   int value[50001];   int n, start, x;   void input() {     for (int i = 1; i <= n; i++) {       scanf( %d %d , &value[i], &nexts[i]);     }   }   ii query(int pos) {     visited[pos] = true;     printf( ? %d n , pos);     fflush(stdout);     ii res;     scanf( %d %d , &res.first, &res.second);     return res;   }   int main() {     srand(time(nullptr));     scanf( %d %d %d , &n, &start, &x);     ii max = query(start);     if (max.first >= x) {       printf( ! %d n , max.first);       fflush(stdout);       return 0;     }     std::vector<int> pick;     for (int i = 1; i <= n; i++) {       if (i == start) continue;       pick.push_back(i);     }     std::random_shuffle(pick.begin(), pick.end());     for (int i = 0; i < std::min(n - 1, 1000); i++) {       auto q = query(pick[i]);       if (q.first < x && q.first > max.first) max = q;     }     if (max.second == -1) {       printf( ! -1 n );       fflush(stdout);       return 0;     }     for (int i = 0; i < 1000; i++) {       auto q = query(max.second);       if (q.first >= x) {         printf( ! %d n , q.first);         fflush(stdout);         return 0;       } else if (q.second == -1) {         printf( ! -1 n );         fflush(stdout);         return 0;       } else {         max = q;       }     }     while (true)       ;     return 0;   }   