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