#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 7;
const int inf = (int)1e9 + 7;
int n, start, xx, cnt;
int mx = -1, id = 0;
int mn2 = -1, id2 = 0;
int nxt[N], val[N];
mt19937 rng(1238293);
pair<int, int> get(int pos) {
  if (val[pos] != -1) {
    return make_pair(val[pos], nxt[pos]);
  }
  ++cnt;
  printf("? %d\n", pos);
  fflush(stdout);
  int vl, nx;
  scanf("%d %d", &vl, &nx);
  nxt[pos] = nx;
  val[pos] = vl;
  return make_pair(val[pos], nxt[pos]);
}
int main() {
  scanf("%d %d %d", &n, &start, &xx);
  for (int i = 1; i <= n; ++i) {
    nxt[i] = -1;
    val[i] = -1;
  }
  if (n < 2000) {
    int mn = -1;
    for (int i = 1; i <= n; ++i) {
      if (get(i).first >= xx) {
        mn = (mn == -1 ? get(i).first : min(mn, get(i).first));
      }
    }
    printf("! %d\n", mn);
    return 0;
  }
  int now = start;
  for (int i = 1; i <= 600; ++i) {
    if (get(now).first >= xx) {
      printf("! %d\n", get(now).first);
      return 0;
    }
    now = get(now).second;
    if (get(now).first < xx) {
      if (get(now).first > mx) {
        mx = get(now).first;
        id = now;
      }
    }
  }
  for (int i = 1; i <= 700; ++i) {
    int pos = rng() % n + 1;
    if (get(pos).first < xx) {
      if (get(pos).first > mx) {
        mx = get(pos).first;
        id = pos;
      }
    }
    if (get(now).first >= xx) {
      if (get(pos).first < mn2 || mn2 == -1) {
        mn2 = get(pos).first;
        id2 = pos;
      }
    }
  }
  if (mx != -1) {
    for (int i = 1; i <= 670; ++i) {
      int nx = get(id).second;
      if (nx == -1) {
        continue;
      }
      if (get(nx).first >= xx) {
        printf("! %d\n", get(nx).first);
        return 0;
      }
      id = nx;
    }
  }
  if (mn2 != -1) {
    printf("! %d\n", mn2);
    return 0;
  }
  printf("! -1\n");
  return 0;
}
