#include <bits/stdc++.h>
using namespace std;
int idx, carry = 0;
int used[100005];
int n, start, x, val, nxt;
set<pair<int, int> > st;
set<pair<int, int> >::iterator it;
void ask(int i) {
  printf("? %d\n", i);
  fflush(stdout);
  scanf("%d", &val);
  scanf("%d", &nxt);
}
int main() {
  srand(time(NULL));
  scanf("%d", &n);
  scanf("%d", &start);
  scanf("%d", &x);
  ask(start);
  used[start] = 1;
  st.insert({val, nxt});
  for (int i = 1; i <= 999; i++) {
    idx = (rand() * rand()) % n + 1;
    if (used[idx]) {
      carry++;
      continue;
    }
    ask(idx);
    used[idx] = 1;
    st.insert({val, nxt});
  }
  int last = 0;
  pair<int, int> cur;
  for (it = st.begin(); it != st.end(); it++) {
    cur = (*it);
    if (cur.first >= x) break;
    last = cur.second;
  }
  if (last == 0) {
    printf("! %d\n", cur.first);
    fflush(stdout);
    return 0;
  } else {
    nxt = last;
    for (int i = 1; i <= 999 + carry && nxt != -1; i++) {
      ask(nxt);
      if (val >= x) {
        printf("! %d\n", val);
        fflush(stdout);
        return 0;
      }
    }
  }
  printf("! -1\n");
  fflush(stdout);
  return 0;
}
