#!/usr/bin/env python3
import functools


@functools.lru_cache(None)
def query(xy): return int(input(f"? {xy[0]} {xy[1]}\n")) if all(0 < i <= n for i in xy) else 0


best, bounds = (1, 1), [[1, (n := int(input())) + 1], [1, n + 1]]  # Lower bound is inclusive, upper bound is exclusive
while any(l + 1 < h for l, h in bounds):
    mid = [(low + high) // 2 for low, high in bounds]
    x, y = max(*((xx, mid[1]) for xx in range(*bounds[0])), *((mid[0], yy) for yy in range(*bounds[1])), key=query)
    best = max(best, *((xx, yy) for yy in range(y - 1, y + 2) for xx in range(x - 1, x + 2)), key=query)
    if (x, y) == best: print("!", query(best)), exit()
    bounds = [[l, m] if b < m else [m + 1, h] for (l, h), m, b in zip(bounds, mid, best)]
print("!", query(best))
