#include <bits/stdc++.h>
using namespace std;
int n, i, val, nex, start, x;
vector<pair<int, pair<int, int> > > v;
void gen(int x, unordered_set<int> &st) {
  int ti = n / x;
  vector<int> v(n + 10);
  for (int i = 1; i <= n; i++) v[i] = i;
  random_shuffle(v.begin() + 1, v.begin() + 1 + n);
  for (int i = 1; i <= n; i += ti) st.insert(v[i]);
}
int32_t main() {
  cin >> n >> start >> x;
  unordered_set<int> st;
  int lol = min(n, 1200);
  gen(lol, st);
  st.insert(start);
  for (int i : st) {
    cout << "? " << i << endl;
    cin >> val >> nex;
    v.push_back(make_pair(val, make_pair(nex, i)));
  }
  sort(v.begin(), v.end());
  auto it = v.end();
  int start_val;
  for (int i = 0; i < v.size(); i++) {
    if (v[i].first <= x) it = v.begin() + i;
    if (v[i].second.second == start) start_val = v[i].first;
  }
  if (it == v.end()) {
    cout << "! " << start_val << endl;
    return 0;
  }
  int cur = it->second.second;
  for (; cur != -1;) {
    cout << "? " << cur << endl;
    cin >> val >> nex;
    if (val >= x or val == -1) {
      cout << "! " << val << endl;
      return 0;
    }
    cur = nex;
  }
  cout << "! -1" << endl;
}
