# -*- coding:utf-8 -*- import sys if __name__ == "__main__": n,k = map(int,raw_input().split()) rest = n % (k+1) if rest == 1: now = 0 else: now = rest - 1 print now sys.stdout.flush() while True: opponent = input() if opponent >= n: exit() now += (k+1) print now sys.stdout.flush()