import sys readline = sys.stdin.readline write = sys.stdout.write flush = sys.stdout.flush # クエリ: "? x1 x2" を出力 def query(x1, x2): write("%d %d\n" % (x1, x2)) flush() # ジャッジから返される値を取得 return readline().strip() # 回答: "! x" を出力 def answer(x): write("%d\n" % x) flush() # 即時終了 exit(0) N = int(input()) if N%2==1: s = query(1,(N+1)//2) else: s = query(2,N//2) while s=='3': a, b = map(int, input().split()) s = query(a,N+1-b-(a-1))