#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char cc = getchar();
  while (cc < '0' || cc > '9') {
    if (cc == '-') f = -1;
    cc = getchar();
  }
  while (cc >= '0' && cc <= '9') {
    x = x * 10 + cc - '0';
    cc = getchar();
  }
  return x * f;
}
int n, start, x, value[50010], nxt[50010];
bool visited[50010];
void getvalue(int d) {
  if (d == -1) return;
  if (nxt[d] != 0) return;
  printf("? %d\n", d);
  fflush(stdout);
  int t1, t2;
  scanf("%d%d", &t1, &t2);
  value[d] = t1;
  nxt[d] = t2;
}
int main() {
  scanf("%d%d%d", &n, &start, &x);
  srand(unsigned((long long)new char));
  memset(nxt, 0, sizeof(nxt));
  getvalue(start);
  for (int i = 1; i <= min(n - 1, 1000); i++) {
    int t = (rand() * rand()) % n + 1;
    while (nxt[t] != 0) t = (rand() * rand()) % n + 1;
    getvalue(t);
  }
  int newstart = -1;
  for (int i = 1; i <= n; i++)
    if (nxt[i] != 0 && value[i] <= x) {
      if (newstart == -1 || value[i] > value[newstart]) newstart = i;
    }
  if (newstart == -1)
    printf("! %d\n", value[start]);
  else if (value[newstart] == x)
    printf("! %d\n", x);
  else {
    int last = newstart, now = nxt[newstart];
    getvalue(now);
    while (now != -1 && value[now] < x) {
      last = now;
      now = nxt[now];
      getvalue(now);
    }
    if (now == -1)
      printf("! -1\n");
    else
      printf("! %d\n", value[now]);
  }
}
