#include <bits/stdc++.h>
using namespace std;
vector<int> arr;
int valid[50005];
int value[50005];
int _next[50005];
int myrandom(int i) { return std::rand() % i; }
int main() {
  srand(time(0));
  int i, j, n, start, x, curr, limit = 1999, best = -1;
  scanf("%d %d %d", &n, &start, &x);
  for (i = 1; i <= n; i++) arr.push_back(i);
  swap(arr[0], arr[start - 1]);
  random_shuffle(arr.begin() + 1, arr.end(), myrandom);
  for (i = 0; i < min(1000, n); i++) {
    curr = arr[i];
    if (!valid[curr] && limit) {
      printf("? %d\n", curr);
      fflush(stdout);
      scanf("%d %d", &value[curr], &_next[curr]);
      limit--;
      valid[curr] = 1;
      if (value[curr] <= x && (best == -1 || value[best] < value[curr]))
        best = curr;
      if (best != -1 && x - value[best] <= limit) break;
    }
  }
  curr = best;
  while (1) {
    if (curr == -1) break;
    if (!valid[curr] && limit) {
      printf("? %d\n", curr);
      fflush(stdout);
      scanf("%d %d", &value[curr], &_next[curr]);
      limit--;
    }
    if (!valid[curr] && !limit) break;
    if (value[curr] >= x) {
      printf("! %d\n", value[curr]);
      fflush(stdout);
      return 0;
    }
    curr = _next[curr];
  }
  if (value[start] >= x)
    printf("! %d\n", value[start]);
  else
    printf("! -1\n");
  fflush(stdout);
  return 0;
}
