#include <bits/stdc++.h>
using namespace std;
int sec(int a, int b, int x) {
  if (a > b && a <= x) return 1;
  return 0;
}
pair<int, int> get(int index) {
  printf("? %d\n", index);
  fflush(stdout);
  int tv, tn;
  scanf("%d %d", &tv, &tn);
  if (tv == -1 && tn == -1) exit(0);
  return {tv, tn};
}
int main(void) {
  srand(time(0));
  int n, start, x, time = 999;
  scanf("%d%d%d", &n, &start, &x);
  pair<int, int> now = get(start), tmp;
  if (now.first >= x) {
    printf("! %d\n", now.first);
    return 0;
  }
  for (int i = 1; i < 1000; i++) {
    tmp = get((rand() + rand()) % n + 1);
    if (sec(tmp.first, now.first, x)) now = tmp;
  }
  tmp = now;
  while (time--) {
    if (tmp.first <= x && now.first >= x) {
      printf("! %d\n", now.first);
      return 0;
    }
    if (now.second == -1) break;
    tmp = now;
    now = get(tmp.second);
  }
  printf("! -1\n");
  return 0;
}
