class Yukicoder def initialize a = 1 b = 10 ** 9 while a < b c = (a+b)/2 puts "? #{c}" result = gets.to_i if result > 0 a = c else b = c-1 end end puts "! #{a}" end end Yukicoder.new