#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  char c;
  int f = 1;
  while (!isdigit(c = getchar()))
    if (c == '-') f = -1;
  x = (c & 15);
  while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + (c & 15);
  x *= f;
}
int n, m, dl, dr, i, j, k, a[6005], cnt;
double px[12005], py[12005];
double ans[6005], t, res;
int main() {
  read(n);
  read(m);
  read(dl);
  read(dr);
  for ((i) = 1; (i) <= (n); (i)++) read(a[i]);
  cnt = 2;
  px[1] = 1;
  py[1] = 2.0 * (1 - a[1]);
  px[2] = m;
  py[2] = 2.0 * (m - a[1]);
  t = px[1] - py[1] / (py[2] - py[1]) * (px[2] - px[1]);
  ans[1] = t;
  k = 1;
  for ((i) = (2); (i) <= (n); (i)++) {
    for (j = cnt; j > k; j--) {
      px[j + 2] = px[j];
      py[j + 2] = py[j];
    }
    k++;
    px[k] = px[k + 1] = t;
    py[k] = py[k + 1] = 0;
    cnt += 2;
    for ((j) = 1; (j) <= (cnt); (j)++)
      if (j <= k)
        px[j] += dl;
      else
        px[j] += dr;
    for ((j) = 1; (j) <= (cnt); (j)++) py[j] += 2.0 * (px[j] - a[i]);
    if (py[1] >= 0) {
      k = 0;
      t = px[1];
    } else {
      k = 0;
      while (py[k + 1] < 0) k++;
      t = px[k] - py[k] / (py[k + 1] - py[k]) * (px[k + 1] - px[k]);
    }
    ans[i] = t;
  }
  ans[n] = min(ans[n], 1.0 * m);
  for ((i) = (n - 1); (i) >= 1; (i)--) {
    ans[i] = min(ans[i + 1] - dl, max(ans[i + 1] - dr, ans[i]));
  }
  for ((i) = 1; (i) <= (n); (i)++) res += ((ans[i] - a[i]) * (ans[i] - a[i]));
  for ((i) = 1; (i) <= (n); (i)++)
    printf("%.10f%c", ans[i], (i == n ? '\n' : ' '));
  printf("%.10f\n", res);
  return 0;
}
