import math._ object Main { def main(args: Array[String]) { val sc = new java.util.Scanner(System.in) var ans = 0 var lo = 0 var hi = 1000000000 while (lo <= hi) { val m = (lo + hi) / 2 println(s"? ${m}") val n = sc.nextInt n match { case 0 => hi = m - 1 case 1 => { ans = m lo = m + 1 } } } println(s"! ${ans}") } }