#include <bits/stdc++.h>
using namespace std;
int n, Q, A, B;
struct point {
  double x, y;
  inline point() { x = y = 0; }
  inline point(double _x, double _y) {
    x = _x;
    y = _y;
  }
  inline bool operator<(const point a) const { return y + 1e-12 < a.y; }
};
vector<point> D;
vector<point>::iterator up, down;
double ansX[10000], ans;
inline double get_min_point() {
  up = lower_bound(D.begin(), D.end(), point(0, -1e-12));
  if (fabs(up->y) <= 1e-12) return up->x;
  down = up - 1;
  return (up->y * down->x - up->x * down->y) / (up->y - down->y);
}
double solve(int i) {
  if (i == n)
    return max(min(get_min_point(), (double)Q), (double)(n - 1) * A + 1);
  double X;
  scanf("%lf", &X);
  if (i == 0) {
    D.push_back(point(1.0, -1e30));
    D.push_back(point(1.0, 2.0 * (1 - X)));
    D.push_back(point((double)Q, 2.0 * (Q - X)));
    ansX[i] = solve(i + 1);
    ans += ((X - ansX[i]) * (X - ansX[i]));
    return 0;
  }
  double min_point = get_min_point();
  vector<point>::iterator pos = D.begin();
  if (A != B) {
    if (fabs(up->y) <= 1e-12)
      pos = D.insert(up, *up);
    else {
      pos = D.insert(up, point(min_point, 0));
      pos = D.insert(pos, point(min_point, 0));
    }
  }
  for (vector<point>::iterator it = D.begin(); it != D.end(); it++) {
    if (it <= pos)
      it->x += A;
    else
      it->x += B;
    it->y += 2.0 * (it->x - X);
  }
  ansX[i] = solve(i + 1);
  ans += ((X - ansX[i]) * (X - ansX[i]));
  return ansX[i] < min_point + A   ? ansX[i] - A
         : ansX[i] > min_point + B ? ansX[i] - B
                                   : min_point;
}
int main() {
  scanf("%d%d%d%d", &n, &Q, &A, &B);
  solve(0);
  for (int i = -1; ++i != n;) printf("%lf ", ansX[i]);
  printf("\n%lf\n", ans);
  return 0;
}
