#include <bits/stdc++.h>
using namespace std;
int get_rand(int x) { return rand() * rand() % x + 1; }
int a[50010], nxt[50010];
int maxid, n, m, t;
bool used[50010];
int main() {
  srand(20020214);
  scanf("%d%d%d", &n, &m, &t);
  printf("? %d\n", m);
  fflush(stdout);
  scanf("%d%d", &a[m], &nxt[m]);
  if (a[m] < t)
    maxid = m;
  else {
    printf("! %d\n", a[m]);
    return 0;
  }
  used[m] = 1;
  int i;
  for (i = 1; i < min(1000, n); i++) {
    int x = get_rand(n);
    while (used[x] == 1) x = get_rand(n);
    used[x] = 1;
    printf("? %d\n", x);
    fflush(stdout);
    scanf("%d%d", &a[x], &nxt[x]);
    if (a[x] < t && a[x] > a[maxid]) maxid = x;
  }
  for (i = maxid; a[i] < t;) {
    if (nxt[i] == -1) {
      printf("! -1\n");
      return 0;
    }
    i = nxt[i];
    if (a[i] == 0) {
      printf("? %d\n", i);
      fflush(stdout);
      scanf("%d%d", &a[i], &nxt[i]);
    }
  }
  printf("! %d\n", a[i]);
}
