#include <bits/stdc++.h>
using namespace std;
long long f[112345];
int n, ppp, pp, s, t, d[112345];
int main() {
  scanf("%d%d%d", &n, &s, &t);
  for (int i = 1; i <= n; i++) scanf("%d", &d[i]);
  pp = 0;
  f[0] = 0;
  for (int i = 1; i <= n; i++) f[i] = (1 << 31) - 1;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < i; j++)
      f[i] = min(f[i], f[j] + max(2 * (d[i] - d[j + 1]), t));
  for (int i = 1; i <= n; i++) printf("%lld ", f[i]);
  printf("\n");
  printf("%lld\n", s + f[n]);
}
