N, D = map(int,input().split()) l = list(map(int, input().split())) nowp = 0 suml = 0 ans = "0 " for l_i in l: suml += l_i if suml - nowp < D: nowp += D ans += (str(nowp) + " ") else: nowp = suml ans += (str(nowp) + " ") print(ans)