#include <bits/stdc++.h>
using namespace std;
struct ww {
  long double A, B, C, L;
} a[13000], c[13000];
int i, j, k, n, m;
long double b[13000], mi[13000], an[13000], ans[13000];
double Q, L, R, tmp;
inline long double get(ww A, long double x) {
  return A.A * x * x + A.B * x + A.C;
}
int main() {
  scanf("%d%lf%lf%lf", &n, &Q, &L, &R);
  for (i = 1; i <= n; i++) scanf("%lf", &tmp), b[i] = tmp - (i - 1) * L;
  a[1] = (ww){1, -2 * b[1], b[1] * b[1], 1};
  a[m = 2] = a[1];
  a[2].L = b[1];
  mi[1] = b[1];
  if (b[1] == 1) m = 1;
  for (i = 2; i <= n; i++) {
    if (L < R) {
      long double D = R - L;
      for (j = 1; j <= m; j++)
        if (a[j].L == mi[i - 1]) break;
      for (k = m; k >= j; k--) {
        a[k + 1] = (ww){a[k].A, -2 * a[k].A * D + a[k].B,
                        a[k].C + a[k].A * D * D - a[k].B * D, a[k].L + D};
      }
      m++;
      a[j] = (ww){0, 0, an[i - 1], mi[i - 1]};
    }
    a[m + 1].L = 1e15;
    int t = 0;
    for (j = 1; j <= m; j++) {
      a[j].A += 1;
      a[j].B += -2 * b[i];
      a[j].C += b[i] * b[i];
      c[++t] = a[j];
      long double ji = a[j].B / -2 / a[j].A;
      if (a[j].L < ji && ji < a[j + 1].L) {
        c[++t] = a[j];
        c[t].L = ji;
      }
    }
    m = t;
    for (j = 1; j <= m; j++) a[j] = c[j];
    a[m + 1].L = 1e15;
    long double lim = Q - (i - 1) * L;
    for (j = 1; j <= m; j++) {
      long double s = get(a[j], a[j].L);
      if (j == 1 || s < an[i]) {
        an[i] = s;
        mi[i] = a[j].L;
      }
      if (a[j + 1].L > lim) {
        s = get(a[j], lim);
        if (s < an[i]) {
          an[i] = s;
          mi[i] = lim;
          a[j + 1] = a[j];
          a[j + 1].L = lim;
          m = j + 1;
          break;
        }
        m = j;
        break;
      }
    }
  }
  ans[n] = mi[n];
  for (i = n - 1; i; i--)
    ans[i] = ans[i + 1] -
             min((long double)R - L, max((long double)0, ans[i + 1] - mi[i]));
  for (i = 1; i <= n; i++) printf("%.12lf ", (double)ans[i] + (i - 1) * L);
  printf("\n");
  printf("%.12lf\n", (double)an[n]);
  return 0;
}
