#include <bits/stdc++.h>
using namespace std;
const int MAGIC = 999;
int n, start, x;
pair<int, int> ask(int pos) {
  cout << "? " << pos << "\n";
  cout.flush();
  int val, nex;
  cin >> val >> nex;
  if (val == -1)
    while (true) {
      val++;
    }
  return make_pair(val, nex);
}
void search(int pos) {
  while (true) {
    pair<int, int> p = ask(pos);
    if (p.first >= x) {
      cout << "! " << p.first << "\n";
      return;
    }
    if (p.second == -1) {
      cout << "! -1\n";
      return;
    }
    pos = p.second;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  srand(time(NULL));
  cin >> n >> start >> x;
  vector<pair<int, int> > V;
  pair<int, int> st = ask(start);
  V.push_back(make_pair(st.first, start));
  vector<int> queries;
  for (int i = (0); i <= ((int)n - 1); ++i) queries.push_back(i + 1);
  random_shuffle(queries.begin(), queries.end());
  for (int i = (0); i <= ((int)min(MAGIC, (int)queries.size()) - 1); ++i) {
    int pos = queries[i];
    pair<int, int> p = ask(pos);
    V.push_back(make_pair(p.first, pos));
  }
  sort(V.begin(), V.end());
  if (V[0].first >= x) {
    cout << "! " << V[0].first << "\n";
    return 0;
  }
  for (int i = (0); i <= ((int)V.size() - 1 - 1); ++i) {
    if (V[i].first <= x && V[i + 1].first > x) {
      search(V[i].second);
      return 0;
    }
  }
  search(V[V.size() - 1].second);
  return 0;
}
