#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  srand(time(0));
  int n, start, x;
  cin >> n >> start >> x;
  vector<int> random;
  cout << "? " << start << endl;
  int value, nxt;
  cin >> value >> nxt;
  for (int i = 1; i <= n; i++) random.push_back(i);
  random_shuffle(random.begin(), random.end());
  random_shuffle(random.begin(), random.end());
  for (int i = 0; i < min(999, n); i++) {
    cout << "? " << random[i] << endl;
    int val, nx;
    cin >> val >> nx;
    if (val <= x && val >= value) value = val, nxt = nx;
  }
  for (int i = 0; i < 999 && value < x && nxt != -1; i++) {
    cout << "? " << nxt << endl;
    int val, nx;
    cin >> val >> nx;
    if (val >= x) value = val;
    nxt = nx;
  }
  if (value < x) value = -1;
  cout << "! " << value << endl;
  return 0;
}
