import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int t = (n - 1) % (k + 1); System.out.println(t); System.out.flush(); while(true) { int a = sc.nextInt(); if(a >= n) { break; } else { int s = (n - 1 - a) % (k + 1); System.out.println(a + s); } } System.exit(0); } }