import java.util.Scanner; public class Yuki257 { int MOD = 1000000007; public Yuki257() { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int K = scanner.nextInt(); int A = (N - 1) % (K + 1); while (true) { System.out.println(A); System.out.flush(); A += K + 1; int V = scanner.nextInt(); if (V >= N) { break; } } } public static void main(String[] args) { Yuki257 hoge = new Yuki257(); } }