#include <bits/stdc++.h>
using namespace std;
int queries;
pair<int, int> ask(int i) {
  cout << "? " << i << '\n';
  cout.flush();
  int v, next;
  cin >> v >> next;
  if (v == -1 && next == -1) exit(0);
  ++queries;
  return make_pair(v, next);
}
void answer(int ans) {
  cout << "! " << ans << '\n';
  cout.flush();
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  srand(0x1D8390Fu);
  int N, start, X;
  cin >> N >> start >> X;
  vector<int> vs(N + 1, -2);
  vector<int> nexts(N + 1, -2);
  tie(vs[start], nexts[start]) = ask(start);
  int beg = start;
  int begv = vs[start];
  while (queries < min(1800, N / 2)) {
    int i = (((rand() & 0x7FFF) | (rand() << 15)) % N) + 1;
    if (vs[i] != -2) continue;
    tie(vs[i], nexts[i]) = ask(i);
    if (vs[i] > begv && vs[i] < X) {
      beg = i;
      begv = vs[i];
    }
  }
  int i = beg;
  int v = begv;
  while (v < X) {
    int ni = nexts[i];
    if (ni == -1) {
      i = -1;
      v = -1;
      break;
    }
    tie(vs[ni], nexts[ni]) = ask(ni);
    int nv = vs[ni];
    i = ni;
    v = nv;
  }
  answer(v);
  return 0;
}
