#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
const int N3 = 1e3 + 10;
const int INF = 2e9 + 10;
const long long LINF = 2e18;
const int SMOD = 50000;
int n, start, x, val, ans, start_pos, order[N / 2];
bool u[N / 2];
int nxt[N / 2], cost[N / 2];
int main() {
  if ("" != "") {
    freopen(
        ""
        ".in",
        "r", stdin);
    freopen(
        ""
        ".out",
        "w", stdout);
  }
  ans = INF;
  cin >> n >> start >> x;
  if (n < 2000) {
    int to;
    for (int nxt = start; nxt != -1; nxt = to) {
      cout << "? " << nxt << '\n';
      fflush(stdout);
      cin >> val >> to;
      if (val >= x) ans = min(val, ans);
    }
    if (ans == INF)
      cout << "! " << -1 << '\n';
    else
      cout << "! " << ans << '\n';
    return 0;
  } else {
    int to;
    start_pos = start;
    int cnt = 0;
    for (int i = 1; i <= n; ++i) {
      order[i] = i;
    }
    random_shuffle(order + 1, order + n + 1);
    random_shuffle(order + 1, order + n + 1);
    while (cnt < 1000) {
      cnt++;
      to = order[cnt];
      cout << "? " << to << '\n';
      fflush(stdout);
      int pos;
      cin >> val >> pos;
      u[to] = 1;
      nxt[to] = pos;
      cost[to] = val;
    }
    int mx = -INF;
    for (int i = 1; i <= n; ++i) {
      if (u[i] && cost[i] < x && cost[i] > mx) {
        start_pos = i;
        mx = cost[i];
      }
    }
    while (cnt < 1999) {
      cnt++;
      cout << "? " << start_pos << '\n';
      fflush(stdout);
      cin >> val >> start_pos;
      if (val >= x) {
        cout << "! " << val << '\n';
        fflush(stdout);
        return 0;
      }
      if (start_pos == -1) {
        cout << "! -1\n";
        fflush(stdout);
        return 0;
      }
    }
  }
  cout << "! -1\n";
  fflush(stdout);
  return 0;
}
