#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 9;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int x) {
  long long res = rng() % mod;
  return 1 + ((int(res) + x) % x);
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, st, x, a, b;
  cin >> n >> st >> x;
  set<pair<int, int>> s;
  set<int> ck;
  int cnt = 1999;
  vector<pair<int, int>> vis(n + 1, {-1, -1});
  cnt--;
  cout << "? " << st << endl;
  cin >> a >> b;
  vis[st] = {a, b};
  s.insert({a, b});
  ck.insert(st);
  while (cnt > 1000) {
    int z;
    while (ck.size() < n and ck.count(z = rnd(n)))
      ;
    if (ck.size() == n) break;
    cout << "? " << z << endl;
    cerr << "##\n";
    cin >> a >> b;
    vis[z] = {a, b};
    s.insert({a, b});
    ck.insert(z);
    cnt--;
  }
  auto it = s.upper_bound({x, 1e9});
  if (it != s.begin()) --it;
  if (it->first >= x) return (cout << "! " << it->first << endl), 0;
  int z = it->second, ans = 1e9 + 4;
  for (int i = 0; i < cnt and z != -1;) {
    if (vis[z].second == -1) {
      cout << "? " << z << endl;
      cin >> a >> z;
      i++;
    } else {
      a = vis[z].first;
      z = vis[z].second;
    }
    if (a >= x) return (cout << "! " << a << endl), 0;
  }
  cout << "! " << (ans == 1e9 + 4 ? -1 : ans) << endl;
  return 0;
}
