#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T& n) {
  char ch;
  int sign = 1;
  while (!isdigit(ch = getchar()))
    if (ch == '-') sign = -1;
  n = ch - '0';
  while (isdigit(ch = getchar())) n = n * 10 + ch - '0';
  n *= sign;
}
const int INF = 1e9 + 7;
const int N = 51111;
int n, start, first, vis[N], nxt[N];
pair<int, int> mi[N], mem[N];
pair<int, int> ask(int first) {
  if (vis[first]) return mem[first];
  printf("? %d\n", first);
  fflush(stdout);
  pair<int, int> tmp;
  read(tmp.first), read(tmp.second);
  vis[first] = 1, mem[first] = tmp;
  return tmp;
}
int main() {
  srand(time(0));
  read(n), read(start), read(first);
  for (int i = (1); i <= (n); ++i) nxt[i] = i;
  random_shuffle(nxt + 1, nxt + n + 1);
  pair<int, int> tmp = ask(start);
  int mi = tmp.first, v = tmp.second;
  for (int i = 1; i <= min(1000, n); i++) {
    pair<int, int> tmp = ask(nxt[i]);
    if (tmp.first <= first && tmp.first > mi) mi = tmp.first, v = tmp.second;
  }
  for (; v != -1;) {
    if (mi >= first) break;
    pair<int, int> tmp = ask(v);
    mi = tmp.first, v = tmp.second;
  }
  if (mi >= first)
    printf("! %d\n", mi);
  else
    puts("! -1");
  fflush(stdout);
  return 0;
}
