#include <bits/stdc++.h>
template <class T>
void read(T &x) {
  int f = 1;
  char c = getchar();
  x = 0;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  x *= f;
}
template <class T>
void write(T x) {
  int len = 0;
  char s[30];
  if (x < 0) putchar('-'), x = -x;
  do {
    s[++len] = x % 10;
    x /= 10;
  } while (x);
  while (len) putchar(s[len--] + '0');
}
template <class T>
inline bool gmin(T &a, T b) {
  return a > b ? a = b, true : false;
}
template <class T>
inline bool gmax(T &a, T b) {
  return a < b ? a = b, true : false;
}
const double eps = 1e-10;
const int maxn = 6000 + 5;
struct Point {
  double x, y;
  Point() {}
  Point(double x, double y) : x(x), y(y) {}
} p[maxn << 1];
int n, q, a, b, x[maxn];
int n0, mp;
double f[maxn], ans;
inline int dcmp(const double &x) {
  return std::fabs(x) < eps ? 0 : (x < 0 ? -1 : 1);
}
double findmin() {
  mp = 0;
  for (int i = 1; i < n0; i++)
    if (dcmp(p[i].y) <= 0 && dcmp(p[i + 1].y) >= 0) {
      mp = i;
      break;
    }
  if (mp == 0) return dcmp(p[1].y) > 0 ? p[1].x : p[n0].x;
  return p[mp + 1].y == p[mp].y ? p[mp].x
                                : p[mp].x - p[mp].y * (p[mp + 1].x - p[mp].x) /
                                                (p[mp + 1].y - p[mp].y);
}
void expand(double v) {
  static Point tmp[maxn << 1];
  for (int i = 1; i <= mp; i++) tmp[i] = Point(p[i].x + a, p[i].y);
  tmp[mp + 1] = Point(v + a, 0.0);
  tmp[mp + 2] = Point(v + b, 0.0);
  for (int i = mp + 1; i <= n0; i++) tmp[i + 2] = Point(p[i].x + b, p[i].y);
  n0 += 2;
  for (int i = 1; i <= n0; i++) p[i] = tmp[i];
  while (dcmp(p[n0 - 1].x - q) > 0) n0--;
  p[n0] = Point(q, p[n0].y - (p[n0].x - q) * (p[n0].y - p[n0 - 1].y) /
                                 (p[n0].x - p[n0 - 1].x));
}
int main() {
  read(n);
  read(q);
  read(a);
  read(b);
  for (int i = 1; i <= n; i++) read(x[i]);
  n0 = 0;
  p[++n0] = Point(1, 2.0 * (1 - x[1]));
  p[++n0] = Point(q, 2.0 * (q - x[1]));
  f[1] = findmin();
  for (int i = 2; i <= n; i++) {
    expand(f[i - 1]);
    for (int j = 1; j <= n0; j++) p[j].y += 2.0 * (p[j].x - x[i]);
    f[i] = findmin();
  }
  f[n] = std::min(f[n], (double)q);
  for (int i = n - 1; i >= 1; i--) {
    if (dcmp(f[i + 1] - f[i] - a) < 0) {
      f[i] = f[i + 1] - a;
      continue;
    }
    if (dcmp(f[i + 1] - f[i] - b) > 0) {
      f[i] = f[i + 1] - b;
      continue;
    }
  }
  for (int i = 1; i <= n; i++) ans += ((f[i] - x[i]) * (f[i] - x[i]));
  for (int i = 1; i <= n; i++) printf("%.6lf ", f[i]);
  putchar('\n');
  printf("%.6lf\n", ans);
  return 0;
}
