import java.util.Scanner; public class prog { public static void main (String[] args) throws java.lang.Exception { Scanner scanner = new Scanner(System.in); String[] data = scanner.nextLine().split(" "); int low = 0; int high = Integer.parseInt(data[0]); while(low + 1 < high){ int mid = (low+high)/2; System.out.println("query "+mid); String res = scanner.nextLine(); if(res.equals("broke")){ high = mid; } else if (res.equals("survived")){ int i = mid+1; for (; i < Integer.parseInt(data[0]) && res.equals("survived"); i++) { System.out.println("query "+i); res = scanner.nextLine(); } System.out.println("answer "+(i-2)); } } } }