import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int n = sc.nextInt(); final int k = sc.nextInt(); Deque s = new ArrayDeque<>(); for(int i = n-1; i >= 0; i -= k+1) s.push(i); while(!s.isEmpty()) { System.out.println(s.pop()); if(sc.nextInt() >= n) break; } } }