#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
const int maxlen = (int)(1e5) + 10;
const int base = (int)(1e9);
const long long mod = 1073676287;
const long long bigmod = 99194853094755497ll;
const long long infinity = (long long)1e18;
vector<int> x, nums;
int cmp(int a, int b) { return x[a] < x[b]; }
int main() {
  int n, start, x;
  scanf("%d%d%d", &n, &start, &x);
  vector<pair<int, int> > list(n + 1, make_pair(-1, -1));
  list[0].second = start;
  vector<int> q(min(1200, n));
  q[0] = start;
  for (int i = 1; i < q.size(); i++) {
    q[i] = (rand() * q[i - 1]) % n + 1;
  }
  int ans = 0;
  for (int i = 0; i < q.size(); i++) {
    printf("? %d\n", q[i]);
    fflush(stdout);
    scanf("%d%d", &list[q[i]].first, &list[q[i]].second);
    if (list[q[i]].first > list[ans].first && list[q[i]].first < x) ans = q[i];
  }
  while (list[ans].first < x) {
    ans = list[ans].second;
    if (ans == -1) {
      printf("! -1");
      return 0;
    }
    if (list[ans].first == -1) {
      printf("? %d\n", ans);
      fflush(stdout);
      scanf("%d%d", &list[ans].first, &list[ans].second);
    }
  }
  printf("! %d", list[ans].first);
  return 0;
}
