min_x = 0 max_x = 10**9 100.times do x = (max_x - min_x) / 2 + min_x print "? #{x}\n" STDOUT.flush y = gets.strip.to_i if y == 1 min_x = x else max_x = x end if min_x == max_x break end end print "! #{max_x}\n"