import sys readline = sys.stdin.readline # DEBUG = True DEBUG = False N,K = map(int,readline().split()) class Interactive: def __init__(self): self.ques_cnt = 0 self.create_data() def create_data(self): pass def resp_ques(self, *args): import random self.ques_cnt += 1 if self.ques_cnt > 5: return random.randint(N,N+K) x = args[0] if x >= N: raise ValueError('You Lose') return str(x + random.randint(1,K)) + '\n' def resp_ans(self, *args): pass if DEBUG: interactive = Interactive() def question(*args, offset=None): if offset is None: print(*args, flush=True) else: print(offset, *args, flush=True) if DEBUG: resp = interactive.resp_ques(*args) print(resp, end='') return resp else: return readline() def answer(*args, offset=None): if offset is None: print(*args, flush=True) else: print(offset, *args, flush=True) if DEBUG: interactive.resp_ans(*args) else: exit() x = (N-1) % (K+1) for _ in range(10): resp = int(question(x)) if resp >= N: exit() x = x + K + 1