def calc_dist(base_row, base_col, se_row, se_col): # 1-indexで、(se_row, se_col)は(base_row, base_col)からどれだけ離れているか?ユークリッド距離の2乗。 return (base_row - se_row)**2 + (base_col - se_col)**2 H, W = map(int, input().split()) ###################################################### print("? 1 1") d1 = int(input()) # 左上からの距離(の2乗) ans_candidate = 0 # 答えの候補になるマスの個数 for row in range(1, H + 1): for col in range(1, W + 1): if calc_dist(1, 1, row, col) == d1: ans_candidate += 1 if ans_candidate == 1: for row in range(1, H + 1): for col in range(1, W + 1): if calc_dist(1, 1, row, col) == d1: print(f"! {row} {col}") exit() ###################################################### print(f"? {H} {W}") d2 = int(input()) # 右下からの距離(の2乗) ans_candidate = 0 # 答えの候補になるマスの個数 for row in range(1, H + 1): for col in range(1, W + 1): if calc_dist(1, 1, row, col) == d1 and calc_dist(H, W, row, col) == d2: ans_candidate += 1 if ans_candidate == 1: for row in range(1, H + 1): for col in range(1, W + 1): if calc_dist(1, 1, row, col) == d1 and calc_dist(H, W, row, col) == d2: print(f"! {row} {col}") exit() ##################################################### # 候補は二つしかないはず。 ans_row_1 = None ans_col_1 = None ans_row_2 = None ans_col_2 = None for row in range(1, H + 1): for col in range(1, W + 1): if calc_dist(1, 1, row, col) == d1 and calc_dist(H, W, row, col) == d2: if ans_row_1 == None: ans_row_1, ans_col_1 = row, col else: ans_row_2, ans_col_2 = row, col print(f"? {ans_row_1} {ans_col_1}") if int(input()) == 0: print(f"! {ans_row_1} {ans_col_1}") exit() print(f"! {ans_row_2} {ans_col_2}") exit()