#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int sz = 2e5 + 10;
const int inf = 1e9 + 10;
int fl[sz], n;
int main() {
  int s, x, val, nxt, ans, mn_mx, id;
  scanf("%d %d %d", &n, &s, &x);
  if (n < 2000) {
    ans = inf;
    for (int i = 1; i <= n; i++) {
      printf("? %d\n", i);
      fflush(stdout);
      scanf("%d %d", &val, &nxt);
      if (val >= x) ans = min(ans, val);
    }
    if (ans == inf) ans = -1;
    printf("! %d\n", ans);
    fflush(stdout);
  } else {
    mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
    uniform_int_distribution<int> distribution(1, n);
    ans = inf;
    int h;
    mn_mx = 0;
    id = -1;
    printf("? %d\n", s);
    fflush(stdout);
    scanf("%d %d", &mn_mx, &id);
    if (mn_mx >= x) ans = mn_mx;
    id = s;
    for (int i = 1; i < 1000; i++) {
      while (fl[h = distribution(rng)])
        ;
      fl[h] = 1;
      printf("? %d\n", h);
      fflush(stdout);
      scanf("%d %d", &val, &nxt);
      if (val >= x) {
        ans = min(ans, val);
        if (nxt != -1) fl[nxt] = 1;
      }
      if (val <= x) {
        if (mn_mx < val) {
          mn_mx = val;
          id = nxt;
        }
      }
    }
    for (int i = 1; i < 1000; i++) {
      if (id == -1) break;
      printf("? %d\n", id);
      fflush(stdout);
      scanf("%d %d", &val, &nxt);
      if (val >= x) {
        ans = val;
        break;
      }
      id = nxt;
    }
    if (ans == inf) ans = -1;
    printf("! %d\n", ans);
    fflush(stdout);
  }
  return 0;
}
