n,k = map(int,raw_input().split()) target = [] i = n-1 while i >= 0: target.append(i) i -= (k+1) while target: print target.pop() r = int(raw_input()) if r >= n: break