Problem: You've got a non-decreasing sequence x1, x2, ..., xn (1 ≤ x1 ≤ x2 ≤ ... ≤ xn ≤ q). You've also got two integers a and b (a ≤ b; a·(n - 1) < q).

Your task is to transform sequence x1, x2, ..., xn into some sequence y1, y2, ..., yn (1 ≤ yi ≤ q; a ≤ yi + 1 - yi ≤ b). The transformation price is the following sum: <image>. Your task is to choose such sequence y that minimizes the described transformation price.

Input

The first line contains four integers n, q, a, b (2 ≤ n ≤ 6000; 1 ≤ q, a, b ≤ 109; a·(n - 1) < q; a ≤ b).

The second line contains a non-decreasing integer sequence x1, x2, ..., xn (1 ≤ x1 ≤ x2 ≤ ... ≤ xn ≤ q).

Output

In the first line print n real numbers — the sought sequence y1, y2, ..., yn (1 ≤ yi ≤ q; a ≤ yi + 1 - yi ≤ b). In the second line print the minimum transformation price, that is, <image>.

If there are multiple optimal answers you can print any of them.

The answer will be considered correct if the absolute or relative error doesn't exceed 10 - 6.

Examples

Input

3 6 2 2
1 4 6


Output

1.666667 3.666667 5.666667 
0.666667


Input

10 100000 8714 9344
3378 14705 17588 22672 32405 34309 37446 51327 81228 94982


Output

1.000000 8715.000000 17429.000000 26143.000000 34857.000000 43571.000000 52285.000000 61629.000000 70973.000000 80317.000000 
797708674.000000

Solution (in CPP):

Solution:
#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;
inline 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;
}