#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
static void rmin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
static void rmax(T &x, U y) {
  if (x < y) x = y;
}
const double eps = 1e-9;
const double pi = acos(-1.0);
const int MOD = 1e9 + 7;
const int N = 1e5 + 10;
int n, start, ui;
int vis[N], len;
pair<int, pair<int, int>> p[N];
int main() {
  srand(time(NULL));
  ios::sync_with_stdio(false);
  cin >> n >> start >> ui;
  cout << "?"
       << " " << start << endl;
  fflush(stdout);
  int next, value;
  cin >> value >> next;
  vis[start] = 1;
  p[len++] = make_pair(value, make_pair(start, next));
  if (ui <= value) {
    cout << "!"
         << " " << value << endl;
    return 0;
  }
  vector<int> pos;
  for (int i = 1; i <= n; i++) {
    pos.push_back(i);
  }
  random_shuffle(pos.begin(), pos.end());
  random_shuffle(pos.begin(), pos.end());
  random_shuffle(pos.begin(), pos.end());
  int t = 1200;
  for (int x : pos) {
    if (vis[x]) continue;
    vis[x] = 1;
    t--;
    cout << "?"
         << " " << x << endl;
    fflush(stdout);
    cin >> value >> next;
    p[len++] = make_pair(value, make_pair(x, next));
    if (t == 0) break;
  }
  t = 795;
  sort(p, p + len);
  int u = upper_bound(p, p + len,
                      make_pair(ui, make_pair(1000000009, 1000000009))) -
          p;
  int v = u - 1;
  if (p[v].first == ui) {
    cout << "! " << p[v].first << endl;
    return 0;
  }
  int x = p[v].second.second;
  while (t--) {
    if (x == -1) break;
    cout << "?"
         << " " << x << endl;
    fflush(stdout);
    cin >> value >> next;
    if (value >= ui) {
      cout << "! " << value << endl;
      return 0;
    }
    if (next == -1) break;
    x = next;
  }
  cout << "! -1" << endl;
  return 0;
}
