package main; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); long max = 1000000000; long min = 1; while (min != max) { long num = (min + max) / 2; System.out.println("? " + num); if (sc.nextInt() == 1) { min = num; } else { max = num; } } System.out.println("! " + max); } }