#include <bits/stdc++.h>
using namespace std;
template <typename T>
void mymax(T &_a, T _b) {
  if (_a < _b) _a = _b;
}
template <typename T>
void mymin(T &_a, T _b) {
  if (_a > _b) _a = _b;
}
void print(int _x) { printf("%d\n", _x); }
template <typename T>
void print(T _data[], int _size) {
  for (int i = 1; i <= _size; i++) cout << _data[i] << " ";
  cout << endl;
}
int n, x, st;
int cnt = 0;
pair<int, int> ask(int x) {
  cnt++;
  printf("? %d\n", x);
  fflush(stdout);
  int a, b;
  scanf("%d %d", &a, &b);
  fflush(stdout);
  return make_pair(a, b);
}
void printans(int a) {
  printf("! %d\n", a);
  fflush(stdout);
  exit(0);
}
int Rand() {
  long long rett = (rand() * rand()) % n + 1;
  int ret = rett;
  return ret;
}
bool cantask[500100];
int ans = 0, anspos = -1;
int main() {
  srand(time(0));
  memset(cantask, 0, sizeof(cantask));
  cantask[0] = 1;
  scanf("%d %d %d", &n, &st, &x);
  while (1) {
    if (cnt >= min(1000, n)) break;
    int nowask = 0;
    while (cantask[nowask]) nowask = Rand();
    pair<int, int> ret = ask(nowask);
    if (ret.first == x) printans(x);
    cantask[nowask] = 1;
    if (ret.first < x) {
      if (ans < ret.first) {
        ans = ret.first;
        anspos = nowask;
      }
    } else {
      if (ret.second != -1) cantask[ret.second] = 1;
    }
    cnt++;
  }
  if (ans == 0) anspos = st;
  int nowask = anspos;
  int nowval = 0;
  cnt = 0;
  while (1) {
    pair<int, int> ret = ask(nowask);
    nowval = ret.first;
    if (nowval >= x) printans(nowval);
    cnt++;
    if (cnt >= n || cnt >= 990 || ret.second == -1) printans(-1);
    nowask = ret.second;
  }
  printans(Rand());
  return 0;
}
