#include <bits/stdc++.h>
using namespace std;
const int debug = 0;
const int N = 2e5, inf = 1e9 + 10, QQ = 1000, MAXQ = 1999;
int was[N], n, cnt_q = 0, start, x, val[N], nex[N];
int val2[N], nex2[N];
int getr() { return rand() + rand(); }
int main() {
  srand(time(NULL));
  cin >> n >> start >> x;
  fill(val, val + n + 2, -2);
  fill(nex, nex + n + 2, -2);
  int mx = inf, mn = -1, R = -1, L = start;
  for (int i = 0; i < QQ; ++i) {
    int cur = 1, cnt = 0;
    while (was[cur] && cnt < min(n, 1000)) {
      cur = getr() % n + 1;
      ++cnt;
    }
    if (was[cur]) continue;
    cout << "? " << cur << endl;
    if (!debug) {
      cin >> val[cur] >> nex[cur];
    } else {
      val[cur] = val2[cur];
      nex[cur] = nex2[cur];
    }
    was[cur] = 1;
    ++cnt_q;
    assert(cnt_q < MAXQ);
    if (val[cur] == -1) {
      exit(0);
    }
    if (val[cur] >= x) {
      if (val[cur] < mx) {
        mx = val[cur];
        R = cur;
      }
      if (nex[cur] != -1) {
        was[nex[cur]] = 1;
      }
    }
    if (val[cur] < x) {
      if (val[cur] > mn) {
        mn = val[cur];
        L = cur;
      }
      if (nex[cur] != -1) {
        was[nex[cur]] = 1;
      }
    }
  }
  int cur = L, cnt_q2 = 0;
  while (1) {
    if (cur == -1) {
      cout << "! " << -1 << '\n';
      break;
    }
    if (val[cur] == -2) {
      cnt_q2++;
      cout << "? " << cur << endl;
      if (!debug) {
        cin >> val[cur] >> nex[cur];
      }
      ++cnt_q;
      assert(cnt_q < MAXQ);
      if (val[cur] == -1) {
        break;
      }
    }
    if (val[cur] >= x) {
      cout << "! " << val[cur] << '\n';
      break;
    }
    cur = nex[cur];
  }
  if (debug) {
    cerr << "cnt_q = " << cnt_q << ' ' << "cnt_q2 = " << cnt_q2 << '\n';
  }
  exit(0);
  return 0;
}
