#include <bits/stdc++.h>
using namespace std;
const int N = 60000;
int pos[N];
vector<int> ind;
void tira(int idx) {
  auto it = find(begin(ind), end(ind), idx);
  if (it != end(ind)) {
    swap(*it, ind.back());
    ind.pop_back();
  }
}
void print() {
  for (int i = 0; i < ind.size(); i++) {
    assert(i == pos[ind[i]]);
  }
}
int prox[N];
int asked = 0;
int n;
void ask(int i, int& val, int& nxt) {
  assert(asked < 1999);
  assert(1 <= i);
  assert(i <= n);
  cout << "? " << i << endl;
  cin >> val >> nxt;
  assert(val != -1);
  asked++;
}
int main() {
  srand(time(nullptr));
  cin >> n;
  int start, x;
  cin >> start >> x;
  for (int i = 1; i <= n; i++) {
    if (i != start) ind.push_back(i);
  }
  random_shuffle(begin(ind), end(ind));
  ind.push_back(start);
  reverse(begin(ind), end(ind));
  pair<int, int> best(-1, -1);
  for (int i = 0; i < min(500, (int)ind.size()); i++) {
    int k = ind[i];
    int val, nxt;
    ask(k, val, nxt);
    if (val <= x) {
      best = max(best, make_pair(val, nxt));
    } else {
      if (i == 0) {
        cout << "! " << val << endl;
        exit(0);
      }
    }
  }
  while (best.second != -1 && best.first < x) {
    ask(best.second, best.first, best.second);
  }
  if (best.first < x)
    cout << "! -1" << endl;
  else
    cout << "! " << best.first << endl;
  return 0;
}
