#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
int main() {
  int n, start, x;
  cin >> n >> start >> x;
  vector<pair<int, int>> v(n, make_pair(-2, -2));
  cout << "? " << start << endl;
  fflush(stdout);
  int k = 1;
  cin >> v[start - 1].first >> v[start - 1].second;
  if (x <= v[start - 1].first) {
    cout << "! " << v[start - 1].first << endl;
    fflush(stdout);
    return 0;
  }
  int small = v[start - 1].first;
  int great = INT32_MAX;
  int u = v[start - 1].second;
  int g = -2;
  int l = 1;
  srand(time(0));
  while (k++ < min(1000, 3 * n / 4)) {
    int i = (rand() * 1000 + rand()) % n;
    while (v[i].second != -2) {
      i = (rand() * 1000 + rand()) % n;
    }
    cout << "? " << i + 1 << endl;
    fflush(stdout);
    cin >> v[i].first >> v[i].second;
    if (x < v[i].first) {
      v[v[i].second - 1] = make_pair(-3, -3);
      if (v[i].first < great) {
        great = v[i].first;
        g = i + 1;
      }
    } else if (x == v[i].first) {
      cout << "! " << v[i].first << endl;
      fflush(stdout);
      return 0;
    } else {
      if (small < v[i].first) {
        small = v[i].first;
        if (u != i + 1) {
          v[u - 1] = make_pair(-3, -3);
        }
        u = v[i].second;
      } else {
        v[v[i].second - 1] = make_pair(-3, -3);
      }
    }
    if (u == g) {
      cout << "! " << great << endl;
      fflush(stdout);
      return 0;
    }
  }
  while (u != g && u != -1 && k++ < 1999 && v[u - 1].second == -2) {
    cout << "? " << u << endl;
    fflush(stdout);
    cin >> v[u - 1].first >> v[u - 1].second;
    if (x <= v[u - 1].first) {
      cout << "! " << v[u - 1].first << endl;
      fflush(stdout);
      return 0;
    }
    u = v[u - 1].second;
  }
  if (k >= 1999) {
    throw runtime_error("s");
  }
  if (u == -1 || great == INT32_MAX) {
    cout << "! -1\n";
    fflush(stdout);
  } else {
    cout << "! " << great << endl;
    fflush(stdout);
  }
  return 0;
}
