#include <bits/stdc++.h>
using namespace std;
const int N = 50010;
int n, id, x, val[N], nxt[N];
bool hit[N];
void found(int val) {
  cout << "! " << val << '\n';
  cout << flush;
  exit(0);
}
pair<int, int> ask(int pos) {
  cout << "? " << pos << '\n';
  cout << flush;
  pair<int, int> ret;
  cin >> ret.first >> ret.second;
  if (ret.first == -1 and ret.second == -1) found(-1);
  return ret;
}
long long rng() {
  long long r1 = rand(), r2 = rand(), r3 = rand();
  return abs(r1 * r2 * r3);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
  cin >> n >> id >> x;
  if (n < 2000) {
    int ans = -1;
    for (int i = 1; i <= n; i++) {
      int v = ask(i).first;
      if (v >= x) ans = (ans == -1 ? v : min(ans, v));
    }
    found(ans);
  }
  fill(hit, hit + N, 0);
  fill(nxt, nxt + N, -2);
  fill(val, val + N, -2);
  int piv = id;
  auto foo = ask(id);
  val[id] = foo.first;
  nxt[id] = foo.second;
  for (int ty = 1; ty < 1000; ty++) {
    int pos;
    do {
      pos = 1 + rng() % n;
    } while (hit[pos]);
    hit[pos] = 1;
    auto temp = ask(pos);
    val[pos] = temp.first;
    nxt[pos] = temp.second;
    if (val[pos] == x) found(x);
    if (val[pos] < x) {
      if (val[piv] < val[pos]) piv = pos;
    }
  }
  for (int ty = 0; ty < 999; ty++) {
    if (nxt[piv] == -2) {
      auto temp = ask(piv);
      val[piv] = temp.first;
      nxt[piv] = temp.second;
    }
    if (val[piv] >= x) found(val[piv]);
    piv = nxt[piv];
    if (piv == -1) found(-1);
  }
  found(-1);
  return 0;
}
