left = 1 right = 1000000000 target = (left + right ) / 2 puts "?#{target}" unless left == right STDOUT.flush respons = gets.to_i if respons == 1 then left = target target = (left + right ) / 2 else right = target target = (left + right ) / 2 end puts "?#{target}" end puts "!#{target}"