import java.util.Scanner; public class HelloWorld { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int d = sc.nextInt(); int[] ai = new int[n]; ai[0] = 0; for (int i = 1;i < n; i ++) { ai[i] = ai[i - 1] + sc.nextInt(); } sc.close(); for (int i = 0; i < n; i ++) { if (i > 0 && ai[i] < ai[i - 1] + d) { ai[i] = ai[i - 1] + d; } System.out.print(ai[i]); if (i == n - 1) { break; } System.out.print(" "); } } }