#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int n, start, x;
map<int, pair<int, int> > m;
vector<pair<int, int> > v;
int vis[50005];
int known;
int asked;
int main() {
  scanf("%d%d%d", &n, &start, &x);
  mt19937 g1(((((long long)n) * start) % mod * x) % mod);
  int curid = start, curv;
  for (int i = 0; i < 500 && known < 9 * n / 10; i++) {
    int q = (i == 0 ? start : g1() % n + 1);
    while (vis[q]) q = g1() % n + 1;
    assert((++asked) <= 1990);
    assert(1 <= q && q <= n);
    printf("? %d\n", q);
    fflush(stdout);
    known += (vis[q] == 0);
    vis[q] = 1;
    int value, nnext;
    scanf("%d%d", &value, &nnext);
    assert(!(value == -1 && nnext == -1));
    if (i == 0) curv = value;
    known += (vis[nnext] == 0);
    vis[nnext] = 1;
    v.push_back(make_pair((value), (q)));
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size() && v[i].first < x; i++) {
    curv = v[i].first;
    curid = v[i].second;
  }
  while (curv < x && curid != -1) {
    assert((++asked) <= 1990);
    assert(1 <= curid && curid <= n);
    printf("? %d\n", curid);
    fflush(stdout);
    int value, nnext;
    scanf("%d%d", &value, &nnext);
    assert(!(value == -1 && nnext == -1));
    curv = value;
    curid = nnext;
  }
  if (curv < x)
    printf("! %d\n", -1);
  else
    printf("! %d\n", curv);
  fflush(stdout);
  return 0;
}
