#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
void in(int &x);
const int INF = 1e9 + 50;
const int MOD = 1e9 + 7;
int n, start, x;
struct Response {
  int val, nxt;
  Response() {}
  Response(int _val, int _nxt) { val = _val, nxt = _nxt; }
};
int main() {
  auto query = [&](int x) {
    printf("? %d\n", x);
    fflush(stdout);
    Response resp;
    scanf("%d%d", &resp.val, &resp.nxt);
    return resp;
  };
  scanf("%d%d%d", &n, &start, &x);
  srand(time(0));
  Response highest = query(start);
  if (highest.val >= x) {
    printf("! %d\n", highest.val);
    fflush(stdout);
    return 0;
  }
  for (int i = 1; i <= 999; i++) {
    int random = ((rand() << 15) | rand()) % n + 1;
    Response resp = query(random);
    if (resp.val <= x) {
      if (highest.val < resp.val) {
        highest = resp;
      }
    }
  }
  Response lst = highest;
  int sol = highest.val >= x ? highest.val : -1;
  for (int i = 1; i <= 999; i++) {
    Response cur = lst;
    if (cur.val >= x) {
      sol = cur.val;
      break;
    }
    if (cur.nxt == -1) break;
    Response resp = query(cur.nxt);
    lst = resp;
  }
  printf("! %d\n", sol);
  fflush(stdout);
  return 0;
}
