#include <bits/stdc++.h>
using namespace std;
mt19937 gen(time(NULL));
const long double eps = 1e-9;
const int inf = 2e9;
const int mod = 1e9 + 7;
const long long infinity = 2 * 1e18;
pair<int, int> query(int x) {
  if (x == -1) return make_pair(-1, -1);
  cout << "? " << x << '\n';
  cout.flush();
  pair<int, int> ans;
  cin >> ans.first >> ans.second;
  return ans;
}
void ans(int x) {
  cout << "! " << x << '\n';
  cout.flush();
}
void solve(int n, int start, int x) {
  if (n <= 2000 - 1) {
    pair<int, int> j = make_pair(-1, 2e9);
    for (int i = 1; i <= n; i++) {
      pair<int, int> ans = query(i);
      if (ans.first >= x && ans.first < j.second) j = make_pair(i, ans.first);
    }
    cout << "! " << ((j.second == 2e9) ? -1 : j.second) << '\n';
    cout.flush();
    return;
  }
  set<int> st;
  set<pair<int, int> > pidor;
  st.insert(start);
  while (st.size() < 1000) {
    int j = gen() % n + 1;
    st.insert(j);
  }
  int possible_ans = 2e9;
  for (auto v : st) {
    pair<int, int> get = query(v);
    if (get.first >= x) possible_ans = min(possible_ans, get.first);
    pidor.insert(get);
  }
  int q_left = 999;
  int j = -1;
  for (auto v : pidor)
    if (v.first <= x) j = v.second;
  while (q_left--) {
    pair<int, int> ans = query(j);
    if (ans.first >= x) possible_ans = min(possible_ans, ans.first);
    j = ans.second;
  }
  ans((possible_ans == 2e9 ? -1 : possible_ans));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, st, x;
  cin >> n >> st >> x;
  solve(n, st, x);
}
