from math import isqrt def main(): # 入力 H, W = map(int, input().split()) # 計算・出力 def ask(x, y): print(f'? {x+1} {y+1}', flush=True) res = int(input()) if res == -1: exit() return res def ans(x, y): print(f'! {x+1} {y+1}', flush=True) exit() def dist(x1, y1, x2, y2): return (x1 - x2) ** 2 + (y1 - y2) ** 2 if H == 1 and W == 1: ans(0, 0) d1 = ask(0, 0) if H == 1: ans(0, isqrt(d1)) if W == 1: ans(isqrt(d1), 0) N = W-1 d2 = ask(0, N) # x^2 + y^2 = d1 # x^2 + (N-y)^2 = d2 # -> 2yN - N^2 = d1 - d2 y = (d1 - d2 + N*N) // (2*N) x = isqrt(d1 - y*y) ans(x, y) if __name__ == "__main__": main()