#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int mx, pos, n, st, aim;
int vis[100500], v[100500], nxt[100500];
int main() {
  srand(time(NULL));
  n = read();
  st = read();
  aim = read();
  printf("? %d\n", st);
  fflush(stdout);
  vis[st] = 1;
  v[st] = read(), nxt[st] = read();
  if (v[st] >= aim) {
    printf("! %d\n", v[st]);
    fflush(stdout);
    return 0;
  }
  pos = st;
  mx = v[st];
  for (int i = 1; i <= 999; i++) {
    int x = (rand() * 107) % n + 1;
    printf("? %d\n", x);
    fflush(stdout);
    v[x] = read();
    nxt[x] = read();
    if (nxt[x] == -1) {
      if (v[x] < aim) {
        printf("! -1\n");
        fflush(stdout);
        return 0;
      }
      if (v[x] == aim) {
        printf("! %d\n", v[x]);
        fflush(stdout);
        return 0;
      }
    }
    if (v[x] < aim) {
      if (v[x] > mx) mx = v[x], pos = x;
    } else if (v[x] == aim) {
      printf("! %d\n", v[x]);
      fflush(stdout);
      return 0;
    }
  }
  for (int i = 1; i <= 999; i++) {
    pos = nxt[pos];
    printf("? %d\n", pos);
    fflush(stdout);
    v[pos] = read(), nxt[pos] = read();
    if (nxt[pos] == -1) {
      if (v[pos] < aim) {
        puts("! -1");
        fflush(stdout);
        return 0;
      }
    }
    if (v[pos] >= aim) {
      printf("! %d\n", v[pos]);
      fflush(stdout);
      return 0;
    }
  }
  return 0;
}
