func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, start, x;   int order[50005];   pair<int, int> ask(int idx) {     printf( ? %d n , idx);     fflush(stdout);     int val, nxt;     scanf( %d%d , &val, &nxt);     return pair<int, int>(val, nxt);   }   int main() {     srand(time(0));     for (int i = 1; i < 50005; i++) order[i] = i;     scanf( %d%d%d , &n, &start, &x);     random_shuffle(order + 1, order + n + 1);     int ptr = start, ptr_val = INT_MIN;     for (int i = 1; i <= min(n, 1200); i++) {       pair<int, int> p = ask(order[i]);       if (p.first <= x && p.first >= ptr_val) ptr = order[i], ptr_val = p.first;     }     int ans = -1;     while (ptr != -1) {       pair<int, int> y = ask(ptr);       if (y.first >= x) {         ans = y.first;         break;       }       ptr = y.second;     }     printf( ! %d n , ans);   }   