n, k = map(int, input().split()) r = (n - 1) % (k + 1) print(r) i = 1 while True: y = int(input()) if y >= n: break print(i * (k + 1) + r) i += 1