puts "! #{(0..2000).bsearch { |x| puts "? #{x}" a = read_line puts "? #{x + 1}" b = read_line a == b == "out" }.try(&.pred)}"