#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int val[50005], nxt[50005], q[50005];
map<int, int> id;
int main() {
  srand(19260817);
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, s, x, cur;
  cin >> n >> s >> x;
  cout << "? " << s << endl << flush;
  cin >> val[s] >> nxt[s];
  id[val[s]] = s;
  for (int k = 0; k < (n); k++) q[k] = k + 1;
  for (int k = 1; k <= (n); k++) nxt[k] = -2;
  random_shuffle(q, q + n);
  for (int k = 0; k < (min(n, 800)); k++) {
    cur = q[k];
    if (cur == s) continue;
    cout << "? " << cur << endl << flush;
    cin >> val[cur] >> nxt[cur];
    id[val[cur]] = cur;
  }
  map<int, int>::iterator it = id.lower_bound(x);
  if (it != id.begin()) it--;
  cur = it->second;
  while (cur != -1) {
    if (nxt[cur] == -2) {
      cout << "? " << cur << endl << flush;
      cin >> val[cur] >> nxt[cur];
    }
    if (val[cur] >= x) {
      cout << "! " << val[cur] << endl << flush;
      return 0;
    }
    cur = nxt[cur];
  }
  cout << "! -1" << endl << flush;
  return 0;
}
