import sys input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) n = ii() ans = list(range(1, n + 1)) import random for _ in range(600): now = random.choice(ans) print('?', now, flush = True) s = ii() if s == -1: exit() ans2 = [] for v in ans: if v % s == 0: ans2.append(v) ans = ans2 print('!', ans.pop(),flush = True)