#include <bits/stdc++.h>
using namespace std;
const int maxn = 6000 + 15;
const long double eps = 1e-10;
struct Node {
  long double l, r, a, b, c;
  Node() { l = r = a = b = c = 0.0; }
  Node(long double l, long double r, long double a, long double b,
       long double c)
      : l(l), r(r), a(a), b(b), c(c) {}
} now[3 * maxn], pre[3 * maxn];
int sumn, sump;
long double g[maxn][4];
long double minx, mingg;
int mixx;
int n;
long double xx[maxn];
int top;
long double que[maxn];
long double q, a, b;
long double sqr(long double x) { return x * x; }
long double qud(Node a) {
  long double dd = -a.b / 2 / a.a;
  if (dd < a.l) return a.l;
  if (dd > a.r) return a.r;
  return dd;
}
long double anss(Node a, long double x) { return a.a * sqr(x) + a.b * x + a.c; }
int found() {
  minx = qud(pre[1]);
  mingg = anss(pre[1], minx);
  mixx = 1;
  for (int i = 2; i <= sump; i++) {
    long double minxx = qud(pre[i]), minggx = anss(pre[i], minxx), mixxx = i;
    if (minggx < mingg) minx = minxx, mingg = minggx, mixx = mixxx;
  }
  return 0;
}
Node chaa(Node aa, long double l, long double r, long double g) {
  long double a = aa.a, b = aa.b, c = aa.c;
  return Node(l, r, a, -2 * a * g + b, a * sqr(g) - b * g + c);
}
int main() {
  int qq, aa, bb;
  scanf("%d%d%d%d", &n, &qq, &aa, &bb);
  q = qq;
  a = aa;
  b = bb;
  for (int i = 1; i <= n; i++) scanf("%d", &qq), xx[i] = qq;
  sump = 1;
  pre[1] = Node(1, q, 1, -2 * xx[1], sqr(xx[1]));
  for (int i = 2; i <= n; i++) {
    sumn = 0;
    found();
    for (int j = 1; j < mixx; j++)
      if (pre[j].l + a < q + eps)
        now[++sumn] = chaa(pre[j], pre[j].l + a, min(q, pre[j].r + a), a);
    if (pre[mixx].l + a < q + eps)
      now[++sumn] = chaa(pre[mixx], pre[mixx].l + a, min(q, minx + a), a);
    if (minx + a < q + eps)
      now[++sumn] = Node(minx + a, min(q, minx + b), 0, 0, mingg);
    if (minx + b < q + eps)
      now[++sumn] = chaa(pre[mixx], minx + b, min(q, pre[mixx].r + b), b);
    for (int j = mixx + 1; j <= sump; j++)
      if (pre[j].l + b < q + eps)
        now[++sumn] = chaa(pre[j], pre[j].l + b, min(q, pre[j].r + b), b);
    g[i][0] = minx + a;
    g[i][1] = minx + b;
    for (int j = 1; j <= sumn; j++)
      now[j].a++, now[j].b += -2 * xx[i], now[j].c += sqr(xx[i]);
    sump = sumn;
    memcpy(pre, now, sizeof(now));
  }
  found();
  que[top = 1] = minx;
  for (int i = n; i > 1; i--) {
    top++;
    if (que[top - 1] >= g[i][1] - eps)
      que[top] = que[top - 1] - b;
    else if (que[top - 1] <= g[i][0] + eps)
      que[top] = que[top - 1] - a;
    else
      que[top] = g[i][0] - a;
  }
  for (int i = top; i > 1; i--) printf("%.8lf ", (double)que[i]);
  printf("%.8lf\n%.8lf\n", (double)que[1], (double)mingg);
  return 0;
}
