import java.util.Scanner; public class Yukicoder257 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), k = sc.nextInt(), now; int r = (n - 1) % (k + 1), o; now = r; System.out.println(now); System.out.flush(); while (true) { o = sc.nextInt(); if (o >= n) break; now += (k + 1); System.out.println(now); System.out.flush(); } } }