#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int INF = 1e9 + 1;
int main() {
  ios_base::sync_with_stdio(0);
  srand(time(NULL));
  int n, start, x;
  cin >> n >> start >> x;
  bool done[n + 1];
  memset(done, 0, sizeof(done));
  int max_idx_smaller_x = start, min_idx_larger_x = n;
  int max_val_smaller_x = -1, min_val_larger_x = INF;
  for (int f = 0; f < 1800; f++) {
    int ct = 0;
  here:
    int i = ((rand() % n) * (rand() % n)) % n + 1;
    if (done[i]) {
      ct++;
      if (ct < 1000)
        goto here;
      else
        break;
    }
    done[i] = true;
    cout << "? " << i << endl;
    fflush(stdout);
    int val, next;
    cin >> val >> next;
    if (val <= x and max_val_smaller_x < val) {
      max_val_smaller_x = val;
      max_idx_smaller_x = i;
    }
    if (val >= x and min_val_larger_x > val) {
      min_val_larger_x = val;
      min_idx_larger_x = i;
    }
  }
  int i = max_idx_smaller_x;
  if (i == -1) i = start;
  for (int f = 0; f < 199; f++) {
    cout << "? " << i << endl;
    fflush(stdout);
    int val, next;
    cin >> val >> next;
    if (val >= x) {
      cout << "! " << val << endl;
      return 0;
    }
    i = next;
    if (i == -1) break;
  }
  cout << "! -1\n";
  return 0;
}
