import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int lower = 1, upper = 1000000000; // [lower, upper) while(lower + 1 < upper){ final int mid = (lower + upper) / 2; System.out.println("? " + mid); final int ops = sc.nextInt(); if(ops == 1){ lower = mid; }else{ upper = mid; } } System.out.println("! " + lower); } }