import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); ArrayList list = new ArrayList(); for(int i = n-1; i >= 0; i -= k+1) { list.add(i); } Collections.reverse(list); for(int i = 0; i < list.size(); i++) { System.out.println(list.get(i)); if(sc.nextInt() >= n) break; } } }