#include <bits/stdc++.h>
using namespace std;
const int maxn = 50002;
const int pt = 1000;
int bs, bsv;
int n, s, x;
void go(int z) {
  printf("? %d\n", z);
  fflush(stdout);
  int y;
  scanf("%d", &y);
  int nx;
  scanf("%d", &nx);
  assert(y >= 0);
  if (y <= x && y > bsv) {
    bsv = y;
    bs = z;
  }
  fflush(stdout);
}
bool occ[maxn];
int main() {
  srand(time(NULL));
  scanf("%d", &n);
  scanf("%d", &s);
  scanf("%d", &x);
  bs = -1;
  bsv = -1;
  go(s);
  int lf = n - 1;
  fill(occ, occ + n + 1, false);
  occ[s] = true;
  int qry = 1;
  for (int i = 1; i <= pt; i++) {
    if (lf == 0) break;
    int z = s;
    while (occ[z]) {
      z = (rand() * RAND_MAX + rand()) % n;
      z++;
    }
    lf--;
    go(z);
    qry++;
    occ[z] = true;
  }
  int cur = bs;
  if (bs < 0) {
    printf("? %d\n", s);
    fflush(stdout);
    int v, nx;
    scanf("%d", &v);
    scanf("%d", &nx);
    printf("! %d\n", v);
    fflush(stdout);
    return 0;
  }
  for (int i = 1; i <= 1990 - qry; i++) {
    printf("? %d\n", bs);
    fflush(stdout);
    int val, nx;
    scanf("%d", &val);
    scanf("%d", &nx);
    assert(val >= 0);
    if (val >= x) {
      printf("! %d\n", val);
      fflush(stdout);
      return 0;
    }
    bs = nx;
    if (nx < 0) break;
  }
  printf("! -1\n");
  fflush(stdout);
  return 0;
}
