l = 1 h = 10 ** 9 100.times { a = (l + h).div(2) puts "? #{a}" $stdout.flush ans = gets.to_i if ans == 1 l = a else h = a - 1 end break if l == h } ans = Random.rand(l..h) puts "! #{a}" $stdout.flush exit