#include <bits/stdc++.h>
using namespace std;
long long n, m, i, j, k, w, a, b, start, x;
long long arr[1000005], brr[1000005];
map<long long, long long> mp, vis;
vector<long long> vec, v[1000005];
vector<vector<long long> > res;
long long cnt, edges, totver, totedges, mx, ans;
int main() {
  srand(53411);
  ios::sync_with_stdio(false);
  cin >> n >> start >> x;
  for (i = 1; i <= n; i++) arr[i] = i;
  random_shuffle(arr + 1, arr + n + 1);
  for (i = 1; i <= n; i++) {
    brr[arr[i]] = i;
  }
  pair<long long, long long> lo, hi;
  lo = make_pair(INT_MIN, start);
  hi = make_pair(INT_MAX, -1);
  long long val, nxt;
  cout << "? " << start << "\n";
  fflush(stdout);
  cin >> val >> nxt;
  if (val == x) {
    cout << "! " << x << "\n";
    fflush(stdout);
    return 0;
  }
  if (val < x) {
    lo = make_pair(val, nxt);
  }
  for (i = 1; i <= min(n, 1500ll); i++) {
    cout << "? " << brr[i] << "\n";
    fflush(stdout);
    cin >> val >> nxt;
    if (val == x) {
      cout << "! " << x << "\n";
      fflush(stdout);
      return 0;
    } else if (val < x) {
      if (lo.first < val) lo = make_pair(val, nxt);
    }
  }
  long long curr = lo.second;
  while (lo.first < x && lo.second != -1) {
    cout << "? " << lo.second << "\n";
    fflush(stdout);
    cin >> val >> nxt;
    if (val == x) {
      cout << "! " << x << "\n";
      fflush(stdout);
      return 0;
    }
    lo = make_pair(val, nxt);
  }
  if (lo.first >= x) {
    cout << "! " << lo.first << "\n";
    fflush(stdout);
    return 0;
  }
  cout << "! -1"
       << "\n";
  fflush(stdout);
  return 0;
}
