N,K=map(int,input().split()) if (N-1)%(K+1)==0: print(0) now=0 else: print((N-1)%(K+1)) now=(N-1)%(K+1) while True: x=int(input()) if x>=N: break print(now+K+1) now+=K+1