#include <bits/stdc++.h>
using namespace std;
pair<int, int> done[55555];
int main() {
  srand(time(NULL));
  int n, start, x;
  cin >> n >> start >> x;
  for (int i = 1; i <= n; i++) {
    done[i] = make_pair(-1, -1);
  }
  vector<pair<int, int> > vj_j;
  int nq = 1;
  printf("? %d\n", start);
  fflush(stdout);
  int vj, nj;
  cin >> vj >> nj;
  if (vj == -1) {
    while (1) {
    }
  }
  vj_j.push_back({vj, start});
  vector<pair<int, int> > rand_j;
  for (int j = 1; j <= n; j++) rand_j.push_back({rand(), j});
  sort(rand_j.begin(), rand_j.end());
  done[start] = make_pair(vj, nj);
  for (int q = 0; q < rand_j.size(); q++) {
    if (nq >= 1300) break;
    int j = rand_j[q].second;
    if (done[j].first != -1) continue;
    printf("? %d\n", j);
    nq++;
    fflush(stdout);
    int vj, nj;
    cin >> vj >> nj;
    if (vj == -1) {
      while (1) {
      }
    }
    vj_j.push_back({vj, j});
    done[j] = make_pair(vj, nj);
  }
  sort(vj_j.begin(), vj_j.end());
  int cj = -1;
  for (int j = 0; j < vj_j.size(); j++) {
    if (vj_j[j].first <= x) {
      cj = vj_j[j].second;
    } else {
      break;
    }
  }
  if (cj == -1) {
    printf("! %d\n", done[start].first);
    fflush(stdout);
    return 0;
  }
  bool found = false;
  while (1) {
    int vj, nj;
    if (done[cj].first != -1) {
      vj = done[cj].first;
      nj = done[cj].second;
    } else {
      printf("? %d\n", cj);
      nq++;
      if (nq >= 2000) exit(-1);
      fflush(stdout);
      cin >> vj >> nj;
      if (vj == -1) {
        while (1) {
        }
      }
    }
    if (vj >= x) {
      found = true;
      printf("! %d\n", vj);
      fflush(stdout);
      break;
    }
    if (nj == -1) {
      break;
    }
    cj = nj;
  }
  if (!found) {
    printf("! -1\n");
    fflush(stdout);
  }
  return 0;
}
