#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)3e5 + 10;
const double EPS = 1e-10;
struct Splay_tree {
  int l, r, f;
  double s, len, ts, k, b, tk, tb;
} t[MAXN * 3], emp;
int ROOT, tot;
void Clean(int first) {
  if (!first) return;
  double u = 0;
  int l = t[first].l, r = t[first].r;
  if (fabs(t[first].ts) > EPS) {
    u = t[first].ts;
    t[first].ts = 0;
    t[first].s += u;
    t[first].b -= t[first].k * u;
    t[l].ts += u;
    t[r].ts += u;
    t[l].tb -= t[l].tk * u;
    t[r].tb -= t[r].tk * u;
  }
  if (fabs(t[first].tk) > EPS) {
    u = t[first].tk;
    t[first].tk = 0;
    t[first].k += u;
    t[l].tk += u, t[r].tk += u;
  }
  if (fabs(t[first].tb) > EPS) {
    u = t[first].tb;
    t[first].tb = 0;
    t[first].b += u;
    t[l].tb += u, t[r].tb += u;
  }
}
void r_rotate(int first) {
  int f = t[first].f, l = t[first].l;
  ((t[f].l == first) ? (t[f].l) : (t[f].r)) = l;
  t[l].f = f;
  t[first].l = t[l].r, t[t[first].l].f = first;
  t[l].r = first, t[first].f = l;
}
void l_rotate(int first) {
  int f = t[first].f, r = t[first].r;
  ((t[f].l == first) ? (t[f].l) : (t[f].r)) = r;
  t[r].f = f;
  t[first].r = t[r].l, t[t[first].r].f = first;
  t[r].l = first, t[first].f = r;
}
void Splay(int first, int rootf) {
  for (Clean(first); t[first].f != rootf;) {
    int f = t[first].f, g = t[f].f;
    if (!g)
      Clean(f);
    else
      Clean(g), Clean(t[g].l), Clean(t[g].r);
    Clean(t[f].l), Clean(t[f].r), Clean(t[first].l), Clean(t[first].r);
    if (g == rootf)
      if (t[f].l == first)
        r_rotate(f);
      else
        l_rotate(f);
    else if (t[g].l == f)
      if (t[f].l == first)
        r_rotate(g), r_rotate(f);
      else
        l_rotate(f), r_rotate(g);
    else if (t[f].r == first)
      l_rotate(g), l_rotate(f);
    else
      r_rotate(f), l_rotate(g);
  }
  if (!rootf) ROOT = first;
}
int n, v;
double q, a, b, p[MAXN], first[MAXN], second[MAXN];
void init() {
  scanf("%d%lf%lf%lf", &n, &q, &a, &b);
  for (int i = 1; i <= n; ++i) scanf("%lf", &first[i]);
  tot = ROOT = 1;
  t[1].s = 1, t[1].len = q - 1;
  v = 1;
}
vector<double> val;
void Query(int first) {
  Clean(first);
  if (t[first].l) Query(t[first].l);
  printf("%lf %lf %lf %lf\n", t[first].s, t[first].s + t[first].len,
         t[first].s * t[first].k + t[first].b,
         (t[first].s + t[first].len) * t[first].k + t[first].b);
  if (t[first].r) Query(t[first].r);
}
void Ins(int first, int second) {
  int r = t[first].r;
  t[first].r = second, t[second].f = first;
  t[second].l = 0, t[second].r = r, t[r].f = second;
}
void Insert(int first, double p) {
  Splay(first, 0);
  int cur = ++tot;
  t[cur].s = p;
  t[cur].len = b - a;
  int now = ++tot;
  t[now].k = t[first].k, t[now].b = t[first].b;
  t[now].s = p;
  t[now].len = t[first].s + t[first].len - p;
  t[first].len = p - t[first].s;
  Ins(first, now);
  Clean(now);
  t[now].ts += b - a;
  Clean(now);
  if (fabs(t[first].len) < EPS) {
    t[first].k = t[first].b = 0, t[first].len = b - a;
  } else
    Ins(first, cur);
  if (tot > 3) t[ROOT].ts += a;
  Clean(ROOT);
}
void Pop_Right(double q) {
  for (int first;;) {
    for (first = ROOT; t[first].r; first = t[first].r)
      ;
    Splay(first, 0);
    if (t[first].s > q) {
      if (v == first) v = t[first].l;
      ROOT = t[first].l;
      t[first].l = 0;
      first = ROOT;
      t[ROOT].f = 0;
    } else {
      t[first].len = q - t[first].s;
      break;
    }
  }
}
void Pop_Left(double q) {
  for (int first;;) {
    for (first = ROOT; t[first].l; first = t[first].l)
      ;
    Splay(first, 0);
    if (t[first].s + t[first].len < q + EPS) {
      if (v == first) v = t[first].r;
      ROOT = t[first].r;
      t[first].r = 0;
      first = ROOT;
      t[ROOT].f = 0;
    } else {
      t[first].len = t[first].s + t[first].len - q;
      t[first].s = q;
      break;
    }
  }
}
void Add(double tk, double tb) {
  Clean(ROOT);
  t[ROOT].tk += tk, t[ROOT].tb += tb;
  Clean(ROOT);
}
double Find_Min() {
  Splay(v, 0);
  for (;; Clean(v))
    if (t[v].k * t[v].s + t[v].b > EPS) {
      if (!t[v].l) return t[v].s;
      v = t[v].l;
    } else if (t[v].k * (t[v].s + t[v].len) + t[v].b < EPS) {
      if (!t[v].r) return t[v].s + t[v].len;
      v = t[v].r;
    } else
      return -t[v].b / t[v].k;
  return -1;
}
void solve() {
  p[0] = 1;
  for (int i = 1; i <= n; ++i) {
    Insert(v, p[i - 1]);
    Pop_Right(q);
    Add(2, -2.0 * first[i]);
    p[i] = Find_Min();
  }
  second[n] = p[n];
  for (int i = n - 1; i >= 1; --i)
    if (p[i] < second[i + 1] - a + EPS && p[i] + EPS > second[i + 1] - b)
      second[i] = p[i];
    else if (p[i] > second[i + 1] - a)
      second[i] = second[i + 1] - a;
    else
      second[i] = max(second[i + 1] - b, 1.0);
  double Tohka = 0;
  for (int i = 1; i <= n; ++i)
    Tohka += ((first[i] - second[i]) * (first[i] - second[i]));
  for (int i = 1; i <= n; ++i) printf("%.6lf ", second[i]);
  puts("");
  printf("%.6lf\n", Tohka);
}
int main() {
  init();
  solve();
  fclose(stdin);
  fclose(stdout);
  return 0;
}
