import sys def print_num(num): print(num) sys.stdout.flush() nk = input() nk = nk.split(' ') N = int(nk[0]) K = int(nk[1]) diff = K + 1 num = (N+1) % diff while True: print_num(num) num += diff rival = int(input()) if rival >= N - K: break print_num(N - 1) input()