#include <bits/stdc++.h>
using namespace std;
const int N = 3e6;
int n, start, x, nxt[N], a[N];
vector<int> v;
vector<pair<int, int> > g;
void ask(int num) {
  cout << "? " << num << endl;
  cin >> a[num] >> nxt[num];
  g.push_back(make_pair(a[num], num));
}
int main() {
  srand(clock());
  cin >> n >> start >> x;
  ask(start);
  if (a[start] >= x) {
    cout << "! " << a[start];
    return 0;
  }
  for (int i = 1; i <= n; ++i)
    if (i != start) v.push_back(i);
  random_shuffle(v.begin(), v.end());
  for (int i = 0; i < min((int)v.size(), 1500); ++i) ask(v[i]);
  sort(g.begin(), g.end());
  int cur = g.size() - 1;
  while (g[cur].first >= x) --cur;
  cur = g[cur].second;
  while (nxt[cur] != -1) {
    cur = nxt[cur];
    ask(cur);
    if (a[cur] >= x) {
      cout << "! " << a[cur];
      return 0;
    }
  }
  cout << "! -1";
  return 0;
}
