#include <bits/stdc++.h>
using namespace std;
int val[50005];
int Next[50005];
int perm[50005];
void query(int i) {
  printf("? %d\n", i);
  fflush(stdout);
  scanf("%d %d", &val[i], &Next[i]);
}
int main() {
  int n, start, x;
  scanf("%d %d %d", &n, &start, &x);
  query(start);
  srand(time(0));
  for (int i = 0; i < n; i++) perm[i] = i + 1;
  random_shuffle(perm, perm + n);
  for (int i = 0; i < 1000 && i < n; i++) {
    query(perm[i]);
    if (val[perm[i]] > val[start] && val[perm[i]] <= x) start = perm[i];
  }
  while (val[start] < x) {
    start = Next[start];
    if (start == -1) break;
    if (Next[start] == 0) query(start);
  }
  printf("! %d\n", (start == -1) ? -1 : val[start]);
  fflush(stdout);
  return 0;
}
