#include <bits/stdc++.h>
using namespace std;
vector<int> v;
vector<pair<int, int> > ans(100000 + 5);
bitset<100000 + 5> asked;
int main() {
  asked.reset();
  srand(time(NULL));
  int n, start, x, a, b;
  scanf("%d", &n);
  scanf("%d", &start);
  scanf("%d", &x);
  for (int i = 0; i < n; i++) v.push_back(i + 1);
  v[0] = start;
  random_shuffle(v.begin() + 1, v.end());
  int curr = -1, next;
  for (int i = 0; i < min(n, 1000); i++) {
    if (asked[v[i]]) continue;
    asked[v[i]] = true;
    printf("? %d\n", v[i]);
    fflush(stdout);
    scanf("%d", &a);
    scanf("%d", &b);
    ans[v[i]] = make_pair(a, b);
    if (a > x) continue;
    if (a == x) {
      printf("! %d\n", a);
      fflush(stdout);
      return 0;
    }
    if (a <= curr) continue;
    if (a < x) {
      curr = a;
      next = b;
    }
  }
  if (curr == -1) {
    printf("! %d\n", ans[start].first);
    fflush(stdout);
    return 0;
  }
  if (next == -1) {
    printf("! -1\n");
    fflush(stdout);
    return 0;
  }
  while (1) {
    printf("? %d\n", next);
    fflush(stdout);
    scanf("%d", &a);
    scanf("%d", &b);
    if (a >= x) {
      printf("! %d\n", a);
      fflush(stdout);
      return 0;
    }
    if (b == -1) {
      printf("! -1\n");
      fflush(stdout);
      return 0;
    }
    next = b;
  }
  return 0;
}
