#include <bits/stdc++.h>
using namespace std;
const int maxn = 50050;
int n, st, x, ans = 2e9;
int v[maxn], nxt[maxn];
bool vis[maxn];
int main() {
  int i;
  srand(42);
  scanf("%d%d%d", &n, &st, &x);
  int q1 = (n >= 4000 ? 1000 : n / 7 + 1), q2 = 1999 - q1;
  printf("? %d\n", st);
  fflush(stdout);
  scanf("%d %d", &v[st], &nxt[st]);
  vis[st] = 1;
  for (i = 1; i < q1; i++) {
    int p = rand() * rand() % n + 1;
    while (vis[p]) p = rand() * rand() % n + 1;
    printf("? %d\n", p);
    fflush(stdout);
    scanf("%d %d", &v[p], &nxt[p]);
    vis[p] = 1;
  }
  int cur = st;
  for (i = 1; i <= n; i++)
    if (vis[i]) {
      if (v[i] == x || (v[i] < x && v[i] > v[cur])) cur = i;
      if (v[i] >= x) ans = min(ans, v[i]);
    }
  while (q2--) {
    if (v[cur] >= x) {
      ans = v[cur];
      break;
    }
    if (nxt[cur] == -1) break;
    printf("? %d\n", nxt[cur]);
    fflush(stdout);
    cur = nxt[cur];
    scanf("%d %d", &v[cur], &nxt[cur]);
  }
  if (ans == (int)2e9) ans = -1;
  printf("! %d\n", ans);
  fflush(stdout);
  return 0;
}
