Problem: This is an interactive problem.

You are given a sorted in increasing order singly linked list. You should find the minimum integer in the list which is greater than or equal to x.

More formally, there is a singly liked list built on an array of n elements. Element with index i contains two integers: valuei is the integer value in this element, and nexti that is the index of the next element of the singly linked list (or -1, if the current element is the last). The list is sorted, i.e. if nexti ≠ - 1, then valuenexti > valuei.

You are given the number of elements in the list n, the index of the first element start, and the integer x.

You can make up to 2000 queries of the following two types:

  * ? i (1 ≤ i ≤ n) — ask the values valuei and nexti, 
  * ! ans — give the answer for the problem: the minimum integer, greater than or equal to x, or ! -1, if there are no such integers. Your program should terminate after this query. 



Write a program that solves this problem.

Input

The first line contains three integers n, start, x (1 ≤ n ≤ 50000, 1 ≤ start ≤ n, 0 ≤ x ≤ 109) — the number of elements in the list, the index of the first element and the integer x.

Output

To print the answer for the problem, print ! ans, where ans is the minimum integer in the list greater than or equal to x, or -1, if there is no such integer.

Interaction

To make a query of the first type, print ? i (1 ≤ i ≤ n), where i is the index of element you want to know information about.

After each query of type ? read two integers valuei and nexti (0 ≤ valuei ≤ 109,  - 1 ≤ nexti ≤ n, nexti ≠ 0).

It is guaranteed that if nexti ≠ - 1, then valuenexti > valuei, and that the array values give a valid singly linked list with start being the first element.

Note that you can't ask more than 1999 queries of the type ?.

If nexti = - 1 and valuei = - 1, then it means that you asked more queries than allowed, or asked an invalid query. Your program should immediately terminate (for example, by calling exit(0)). You will receive "Wrong Answer", it means that you asked more queries than allowed, or asked an invalid query. If you ignore this, you can get other verdicts since your program will continue to read from a closed stream.

Your solution will get "Idleness Limit Exceeded", if you don't print anything or forget to flush the output, including the final answer.

To flush you can use (just after printing a query and line end):

  * fflush(stdout) in C++; 
  * System.out.flush() in Java; 
  * stdout.flush() in Python; 
  * flush(output) in Pascal; 
  * For other languages see documentation. 



Hacks format

For hacks, use the following format:

In the first line print three integers n, start, x (1 ≤ n ≤ 50000, 1 ≤ start ≤ n, 0 ≤ x ≤ 109).

In the next n lines print the description of the elements of the list: in the i-th line print two integers valuei and nexti (0 ≤ valuei ≤ 109,  - 1 ≤ nexti ≤ n, nexti ≠ 0).

The printed structure should be a valid singly linked list. In particular, it should be possible to reach all elements from start by following links nexti, and the last element end should have -1 in the nextend.

Example

Input

5 3 80
97 -1
58 5
16 2
81 1
79 4


Output

? 1
? 2
? 3
? 4
? 5
! 81

Note

You can read more about singly linked list by the following link: <https://en.wikipedia.org/wiki/Linked_list#Singly_linked_list>

The illustration for the first sample case. Start and finish elements are marked dark. <image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
using namespace std;
inline bool isDigit(char c) { return '0' <= c && c <= '9'; }
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
inline bool isSquare(T x) {
  int y = sqrt(x + 0.5);
  return (y * y) == x;
}
template <class T1, class T2>
inline T1 gcd(T1 a, T2 b) {
  return b ? gcd(b, a % b) : a;
}
template <class T1, class T2>
inline T1 eqMin(T1& x, const T2& y) {
  if (T1(y) < x) return x = y;
  return x;
}
template <class T1, class T2>
inline T1 eqMax(T1& x, const T2& y) {
  if (T1(y) > x) return x = y;
  return x;
}
template <class T1, class T2>
inline T1 min(const T1& x, const T2& y) {
  return x < (T1)y ? x : (T1)y;
}
template <class T1, class T2>
inline T1 max(T1& x, const T2& y) {
  return x > (T1)y ? x : (T1)y;
}
template <typename T>
inline T getint() {
  T x = 0, p = 1;
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  if (ch == '-') p = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * p;
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << '{';
  bool was = false;
  for (const T& x : v) {
    if (was) os << ", ";
    was = true;
    os << x;
  }
  os << '}';
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const set<T>& v) {
  os << '[';
  bool was = false;
  for (const T& x : v) {
    if (was) os << ", ";
    was = true;
    os << x;
  }
  os << ']';
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const multiset<T>& v) {
  os << '[';
  bool was = false;
  for (const T& x : v) {
    if (was) os << ", ";
    was = true;
    os << x;
  }
  os << ']';
  return os;
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const map<T1, T2>& m) {
  os << '<';
  bool was = false;
  for (const auto& x : m) {
    if (was) os << ", ";
    was = true;
    os << x;
  }
  os << '>';
  return os;
}
template <size_t sz>
ostream& operator<<(ostream& os, const bitset<sz>& bit) {
  os << '/';
  for (int i = 0; i < sz; i++) os << bit[i];
  os << '\\';
  return os;
}
const double PI = acos(-1);
const double EPS = 1e-8;
const int INF = (int)2e9;
const long long LINF = (long long)2e18;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)1e5 + 10;
int n, s, x;
int val[MAXN], nxt[MAXN];
int p[MAXN];
bool us[MAXN];
int cnt = 0;
void read(int x) {
  if (us[x]) return;
  us[x] = true;
  cout << "? " << x << "\n";
  cout.flush();
  cin >> val[x] >> nxt[x];
  cout.flush();
}
int main() {
  ios_base::sync_with_stdio(false);
  srand(time(NULL));
  cin >> n >> s >> x;
  cout.flush();
  for (int i = 1; i <= n; i++) {
    p[i] = i;
  }
  random_shuffle(p + 1, p + n + 1);
  read(s);
  int ss = s;
  s = 0;
  val[0] = -1;
  for (int i = 1; i <= min(n / 2, 1300); i++) {
    read(p[i]);
    if (val[p[i]] < x && val[p[i]] > val[s]) {
      s = p[i];
    }
  }
  if (val[ss] < x && val[ss] > val[s]) {
    s = ss;
  }
  if (s) {
    while (val[s] < x) {
      s = nxt[s];
      if (s == -1) {
        cout << "! -1"
             << "\n";
        cout.flush();
        return 0;
      }
      read(s);
      if (val[s] >= x) {
        cout << "! " << val[s] << "\n";
        cout.flush();
        return 0;
      }
      if (nxt[s] == -1) {
        cout << "! -1"
             << "\n";
        cout.flush();
        return 0;
      }
    }
  }
  cout << "! " << val[ss] << "\n";
  cout.flush();
}