import strutils,sequtils,sugar var nd = readLine(stdin).split.mapIt(it.parseInt) var a = readLine(stdin).split.mapIt(it.parseint) var n = nd[0] var d = nd[1] var ls = @[0] for x in a: ls.add(ls[ls.len-1] + x) var lim = n-2 for i in 0..lim: var dif = ls[i+1] - ls[i] if dif < d: ls[i+1] += (d-dif) echo join(ls," ")