#include <bits/stdc++.h>
using namespace std;
int main() {
  srand(130982);
  int n;
  int start;
  int x;
  cin >> n >> start >> x;
  map<int, int> index_to_val;
  vector<int> inds;
  for (int i = 0; i < n / 50 + 3; i++) {
    inds.push_back((start - 1 + 107 * i) % n + 1);
  }
  for (int i = 0; i < inds.size(); i++) {
    cout << "? " << inds[i] << endl;
    int val, scratch;
    cin >> val >> scratch;
    index_to_val[inds[i]] = val;
  }
  int max_b4_index = start;
  int max_b4_value = index_to_val[start];
  for (int i = 0; i < inds.size(); i++) {
    if (index_to_val[inds[i]] > max_b4_value && index_to_val[inds[i]] < x) {
      max_b4_index = inds[i];
      max_b4_value = index_to_val[inds[i]];
    }
  }
  int curr = max_b4_index;
  int val = max_b4_value;
  int queries = inds.size();
  while (val < x) {
    if (queries == 1999 || curr == -1) break;
    cout << "? " << curr << endl;
    cin >> val >> curr;
    queries++;
  }
  if (val < x) val = -1;
  cout << "! " << val << endl;
  return 0;
}
