#include <bits/stdc++.h>
using namespace std;
int val[50005], nxt[50005];
int n, start, x;
void ask(int i) {
  cout << "? " << i << '\n';
  fflush(stdout);
  cin >> val[i] >> nxt[i];
  if (val[i] == x) {
    cout << "! " << x << '\n';
    exit(0);
  }
}
const int ASK_COUNT = 1000;
const int TOOK = 1999 - ASK_COUNT;
int main() {
  memset(val, -1, sizeof val);
  cin >> n >> start >> x;
  ask(start);
  int lw = start;
  if (val[lw] > x) {
    cout << "! " << val[lw] << '\n';
    return 0;
  }
  srand(33);
  for (int i = 1; i < min(n, ASK_COUNT); i++) {
    int idx = abs((rand() << 15) + rand()) % n + 1;
    if (val[idx] != -1) {
      i--;
      continue;
    }
    ask(idx);
    if (val[idx] < x && val[idx] > val[lw]) lw = idx;
  }
  for (int i = 0; i < TOOK; i++) {
    if (nxt[lw] == -1) break;
    ask(nxt[lw]);
    if (val[nxt[lw]] > x) {
      cout << "! " << val[nxt[lw]] << '\n';
      return 0;
    }
    lw = nxt[lw];
  }
  cout << "! " << -1 << '\n';
  return 0;
}
