#include <bits/stdc++.h>
using namespace std;
int n, start, x;
const int maxn = 5e4 + 1;
int pick[maxn];
int main() {
  scanf("%d %d %d", &n, &start, &x);
  int val = -1;
  for (int i = 1; i <= n; ++i) pick[i] = i;
  srand(time(0));
  random_shuffle(pick + 1, pick + n + 1);
  for (int i = 1; i <= min(999, n); ++i) {
    int cur = pick[i];
    printf("? %d\n", cur);
    fflush(stdout);
    int value, next;
    scanf("%d %d", &value, &next);
    if (value <= x && value > val) {
      start = next;
      val = value;
    }
  }
  for (int i = 1; i <= 1000; ++i) {
    if (val >= x) break;
    if (start == -1) break;
    printf("? %d\n", start);
    fflush(stdout);
    int value, next;
    scanf("%d %d", &value, &next);
    val = value;
    start = next;
  }
  if (val < x) val = -1;
  printf("! %d\n", val);
  fflush(stdout);
}
