#include <bits/stdc++.h>
using namespace std;
struct info {
  long long fs, sm, id;
} bd[100001];
int cmp(info a, info b) { return a.fs < b.fs; }
int main() {
  ios_base::sync_with_stdio(0);
  long long int i, j, x, n, cnt = 0, m, y, k, ans = 0, cf, cm, a, rr1 = 0, l, r,
                            md, r1, r2, xxx, flg;
  cin >> n >> a >> cf >> cm >> m;
  long long in[n + 1], bs[n + 1];
  for (i = 1; i <= n; i++) {
    cin >> in[i];
    bd[i].fs = a - in[i];
    bd[i].id = i;
    bs[i] = a - in[i];
  }
  sort(bd + 1, bd + 1 + n, cmp);
  sort(bs + 1, bs + 1 + n);
  for (i = 2; i <= n; i++) {
    bd[i].fs += bd[i - 1].fs;
  }
  bd[n].sm = 0;
  for (i = n - 1; i >= 1; i--) {
    x = abs(in[bd[i + 1].id] - in[bd[i].id]);
    bd[i].sm = bd[i + 1].sm + x * (n - i);
  }
  bd[0].fs = bd[0].id = 0;
  bd[0].sm = (a - in[bd[1].id]) * n + bd[1].sm;
  for (i = 1; i <= n; i++) {
    if (bs[i] > 0) break;
    cnt++;
  }
  ans = cnt * cf + cm * in[bd[n].id];
  for (i = n; i >= 0; i--) {
    x = m;
    y = cnt * cf;
    rr1 = cnt;
    flg = 0;
    if (x >= bd[i].fs) {
      flg = 1;
      y = i * cf;
      x -= bd[i].fs;
      rr1 = i;
    }
    l = i;
    r = n;
    while (r - l > 1) {
      md = (l + r) / 2;
      if (bd[md].sm > x)
        l = md;
      else
        r = md;
    }
    if (bd[l].sm <= x && i != 0) r = l;
    x -= bd[r].sm;
    if (r == i && flg) {
      if (i == n) {
        y = a * cm + n * cf;
        if (ans <= y) {
          ans = y;
          r1 = n;
          r2 = n + 1;
        }
      } else {
        y += cm * (min(a, in[bd[r].id] + x / (n - r)));
        if (ans <= y) {
          ans = y;
          r1 = i;
          xxx = min(a, in[bd[r].id] + x / (n - r));
          r2 = i + 1;
        }
      }
      continue;
    }
    if (r - 1 > 0)
      y += cm * (min(a, min(in[bd[r - 1].id], in[bd[r].id] + x / (n - r + 1))));
    else
      y += cm * (min(a, in[bd[r].id] + x / (n - r + 1)));
    if (y >= ans) {
      ans = y;
      r1 = rr1;
      r2 = r;
      if (r - 1 > 0)
        xxx = min(a, min(in[bd[r - 1].id], in[bd[r].id] + x / (n - r + 1)));
      else
        xxx = min(a, in[bd[r].id] + x / (n - r + 1));
    }
  }
  for (i = 1; i <= r1; i++) {
    in[bd[i].id] = a;
  }
  for (i = r2; i <= n; i++) {
    in[bd[i].id] = xxx;
  }
  cout << ans << endl;
  for (i = 1; i <= n; i++) cout << in[i] << " ";
}
