#include <bits/stdc++.h>
using namespace std;
const int MAXN = 50005;
bool use[MAXN];
struct Node {
  int val, next;
} a, mx;
int main() {
  mt19937 myrand(time(0));
  memset(use, false, sizeof(use));
  int n, s, x, cnt = 1;
  scanf("%d%d%d", &n, &s, &x);
  printf("? %d\n", s);
  fflush(stdout);
  scanf("%d %d", &mx.val, &mx.next);
  use[s] = true;
  for (int i = 1; i < 1000 && cnt < n; i++) {
    cnt++;
    int t = myrand() % n + 1;
    while (use[t]) t = myrand() % n + 1;
    use[t] = true;
    printf("? %d\n", t);
    fflush(stdout);
    scanf("%d %d", &a.val, &a.next);
    if (a.val < x && a.val > mx.val) mx = a;
  }
  for (int i = 1; i < 1000; i++) {
    if (mx.val >= x || mx.next == -1) break;
    printf("? %d\n", mx.next);
    fflush(stdout);
    scanf("%d %d", &a.val, &a.next);
    mx = a;
  }
  if (mx.val < x) mx.val = -1;
  printf("! %d\n", mx.val);
}
