Find Local Peak


You have an n×nn \times n matrix and you are tasked with finding a local peak. A local peak is an element that is larger than all of its adjacent elements, (but not diagonals). It is guaranteed that all n2n^2 elements of the matrix are distinct. You can only query an element in the matrix 10n10 n times.

Interaction

The first line of input contains an integer nn, the size of the matrix.

You can make a query of the form ? x y, which queries the element at position (x,y)(x,y) (0 indexed). The judge will respond with that element, which you can read as a line of input.

You can make a final answer in the form ! x y, stating that there is a local peak at position (x,y)(x,y)

Constraints

  • 2≤n≤20002 \le n \le 2000
  • −1018≤ai,j≤1018-10^{18} \le a_{i,j} \le 10^{18}

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.