#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T mx(T a, T b) {
  return a > b ? a : b;
}
template <class T>
inline T mi(T a, T b) {
  return a < b ? a : b;
}
template <class T>
inline void sw(T &a, T &b) {
  T t = a;
  a = b;
  b = t;
}
inline char gc() {
  char ret;
  while ((ret = getchar()) == ' ' || ret == '\n' || ret == '\t')
    ;
  return ret;
}
const int NIL = -1;
const int LIM = 5e4 + 10;
const int TRY_LIM = 900 - 1;
const int MOV_LIM = 2000 - TRY_LIM - 1;
bool vis[LIM];
inline int mabs(int x) { return x < 0 ? -x : x; }
int main(void) {
  int n, sp, x, nxt, dat;
  scanf("%d%d%d", &n, &sp, &x);
  vis[sp] = true;
  printf("? %d\n", sp);
  fflush(stdout);
  scanf("%d%d", &dat, &nxt);
  if (nxt == -1 && dat < x) {
    printf("! -1\n");
    fflush(stdout);
    return 0;
  }
  if (dat >= x) {
    printf("! %d\n", dat);
    fflush(stdout);
    return 0;
  }
  srand(time(NULL));
  int cost = 0;
  for (int i = 0; i < TRY_LIM; i++) {
    int crt = 0, _cnt = 0;
    while (vis[crt = mabs(rand() * 1007 + 131) % n + 1] && _cnt < n) {
      _cnt++;
    }
    if (_cnt == n) break;
    vis[crt] = true;
    printf("? %d\n", crt);
    fflush(stdout);
    int tnxt, nd;
    scanf("%d%d", &nd, &tnxt);
    if (nd == x) {
      printf("! %d\n", nd);
      fflush(stdout);
      return 0;
    }
    if (nd < x && mabs(nd - x) < mabs(dat - x)) {
      sp = crt;
      nxt = tnxt;
      dat = nd;
    }
    if (nxt == -1 && dat < x) {
      printf("! -1\n");
      fflush(stdout);
      return 0;
    }
    cost++;
  }
  int tnxt, nd;
  for (; cost < 1990; cost++) {
    printf("? %d\n", nxt);
    fflush(stdout);
    scanf("%d%d", &nd, &tnxt);
    if (nd >= x) {
      printf("! %d\n", nd);
      fflush(stdout);
      return 0;
    }
    if (tnxt == -1) {
      printf("! -1\n");
      fflush(stdout);
      return 0;
    }
    nxt = tnxt;
  }
  printf("! -1\n");
  fflush(stdout);
  return 0;
}
