#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MXN = 1e5 + 5;
const int OFF = 1 << 17;
const int MOD = 1e9 + 7;
int add(int x, int y) { return (x += y) < MOD ? x : x - MOD; }
int sub(int x, int y) { return (x -= y) >= 00 ? x : x + MOD; }
int mul(int x, int y) { return (ll)x * y % MOD; }
int pwr(int x, int p) {
  if (p == 0) return 1;
  if (p % 2) return mul(x, pwr(x, p - 1));
  return pwr(mul(x, x), p / 2);
}
int inv(int x) { return pwr(x, MOD - 2); }
int queries = 999;
pair<int, int> ask(int i) {
  --queries;
  cout << "? " << i << endl;
  int value, next;
  cin >> value >> next;
  return {value, next};
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int n, s, x;
  cin >> n >> s >> x;
  auto [sv, sn] = ask(s);
  if (sv >= x) {
    cout << "! " << sv << endl;
    return 0;
  }
  vector<int> ind(n);
  iota(begin(ind), end(ind), 1);
  shuffle(begin(ind), end(ind), rng);
  shuffle(begin(ind), end(ind), rng);
  set<pair<int, int>> set = {{sv, sn}};
  for (int i = 0; i < n && queries; ++i) {
    set.insert(ask(ind[i]));
  }
  queries += 1000;
  auto it = prev(set.lower_bound({x, -1}));
  int curr = it->second;
  while (curr != -1) {
    auto [val, next] = ask(curr);
    if (val >= x) {
      cout << "! " << val << endl;
      return 0;
    }
    curr = next;
  }
  cout << "! -1" << endl;
}
