#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = 2123456789;
const long long INF64 = 1223372036854775807;
const double eps = 1e-7;
template <class T>
T gcd(T a, T b) {
  if (!b) return a;
  return gcd(b, a % b);
}
int nxt[50010];
int pre[50010];
int val[50010];
int main() {
  srand(unsigned(time(NULL)));
  int n, fst, x;
  scanf("%d", &n), scanf("%d", &fst), scanf("%d", &x);
  int maxx = 0, pos = fst;
  for (int i = 0; i < 200; i++) {
    int now = rand() * rand() % n + 1;
    printf("? %d\n", now);
    fflush(stdout);
    int u, v;
    scanf("%d", &u), scanf("%d", &v);
    nxt[now] = v;
    if (v > 0) pre[v] = now;
    val[now] = u;
    if (val[now] >= maxx) {
      if (val[now] < x) {
        maxx = val[now];
        pos = now;
      }
    }
  }
  for (int i = pos, cnt = 0; cnt < 1800; cnt++) {
    if (nxt[i] == 0) {
      printf("? %d\n", i);
      fflush(stdout);
      int u, v;
      scanf("%d", &u), scanf("%d", &v);
      nxt[i] = v;
      pre[v] = i;
      val[i] = u;
    }
    if (val[i] >= x) {
      printf("! %d\n", val[i]);
      fflush(stdout);
      return 0;
    }
    if (nxt[i] == -1) {
      printf("! -1\n");
      fflush(stdout);
      return 0;
    }
    i = nxt[i];
  }
  return 0;
}
