#!/usr/bin/env python3 n = int(input()) x, y = 1, 1 d = [(-1, 0), (0, 1), (1, 0), (0, -1)] def q(x, y): if x < 1 or x > n or y < 1 or y > n: return -1 print("?", x, y) return int(input()) while True: v = q(x, y) # Choose the first better neighbour done = True for dx, dy in d: if q(x + dx, y + dy) > v: x += dx y += dy done = False break if done: print("!", v) break