#!/usr/bin/python import sys n, k = map(int, raw_input().split()) x = (n-1) % (k+1) while 1: print x sys.stdout.flush() x += (k+1) cur = int(raw_input()) if cur >= n: exit(0)