#include <bits/stdc++.h>
using namespace std;
const int maxn = 1500;
int q[maxn + 10], n, s, x, tot, vis[50010], ans = -1, b[50010];
struct node {
  int p, v, nxt;
} a[maxn + 10];
int main() {
  scanf("%d%d%d", &n, &s, &x);
  srand(time(0));
  for (int i = 1; i <= n; i++) b[i] = i;
  random_shuffle(b + 1, b + n + 1);
  for (int i = 1; i <= min(n, 500); i++) q[++tot] = b[i];
  q[++tot] = s;
  for (int i = 1; i <= tot; i++) {
    printf("? %d\n", q[i]);
    fflush(stdout);
    a[i].p = q[i];
    scanf("%d %d", &a[i].v, &a[i].nxt);
  }
  int mn = -1, pos = -1;
  for (int i = 1; i <= tot; i++)
    if (a[i].v <= x && a[i].v > mn) {
      mn = a[i].v;
      pos = a[i].nxt;
    }
  if (mn == -1) {
    mn = 1e9;
    for (int i = 1; i <= tot; i++) mn = min(mn, a[i].v);
    printf("! %d\n", mn);
    return 0;
  }
  while (mn < x && pos != -1 && tot < 1999) {
    printf("? %d\n", pos);
    tot++;
    fflush(stdout);
    scanf("%d %d", &mn, &pos);
  }
  if (mn < x)
    puts("! -1");
  else
    printf("! %d\n", mn);
}
