## TLEテスト

N, D = list(map(int,input().split()))
A = list(map(int, input().split()))

Ll = [(A[i] + i * D, i) for i in range(1, N)]
Lr= [(A[i] + (N-i-1) * D, i) for i in range(0, N-1)]
Ll.sort()
Lr.sort()

L = []
cnt = 0
for i in range(0, N-1):
  while True:
    if Ll[cnt][1] <= i:
      cnt+=1
    else:
      break
  L.append((A[i] + Ll[cnt][0] - i * D, i, Ll[cnt][1]))

cnt = 0
for i in range(N-1, 0, -1):
  while True:
    if Lr[cnt][1] >= i:
      cnt+=1
    else:
      break
  L.append((A[i] + Lr[cnt][0] - (N -1 - i) * D, i, Lr[cnt][1]))

L.sort()