res = [] lo, hi = 0, pow(10, 3) for i in range(8): mi = (lo + hi) // 2 ok = False for x in range(mi - 1, mi + 2): print(f"? {x}") if input() == "safe": ok = True res.append(x) if ok: lo = mi else: hi = mi - 1 print(f"! {max(res)}")