#include <bits/stdc++.h>
struct t {
  long long x, y;
};
bool cmp(t p, t q) { return p.x < q.x; }
bool cmp2(t p, t q) { return p.y < q.y; }
using namespace std;
long long n, A, cf, cm, m, b[100010], s, l, r, tmp, ans, ansi, h, mid;
t a[100010];
int main() {
  scanf("%I64d%I64d%I64d%I64d%I64d", &n, &A, &cf, &cm, &m);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i].x);
  for (int i = 1; i <= n; i++) a[i].y = i;
  sort(a + 1, a + n + 1, cmp);
  a[n + 1].x = A;
  for (int i = 1; i <= n; i++) b[i] = b[i - 1] + a[i].x;
  for (int i = 0; i <= n; i++) {
    s = m - A * (n - i) + b[n] - b[i];
    if (s < 0) continue;
    l = 1;
    r = i;
    while (l < r) {
      mid = (l + r + 1) / 2;
      if (a[mid].x * (mid - 1) - b[mid - 1] <= s)
        l = mid;
      else
        r = mid - 1;
    }
    s = s - a[l].x * (l - 1) + b[l - 1];
    h = min(s / l, A - a[l].x);
    if (i == 0)
      tmp = (A * cm + n * cf);
    else
      tmp = (a[l].x + h) * cm + (n - i) * cf;
    if (tmp >= ans) {
      ans = tmp;
      ansi = i;
    }
  }
  printf("%I64d\n", ans);
  long long i = ansi;
  s = m - A * (n - i) + b[n] - b[i];
  l = 1;
  r = i;
  while (l < r) {
    mid = (l + r + 1) / 2;
    if (a[mid].x * (mid - 1) - b[mid - 1] <= s)
      l = mid;
    else
      r = mid - 1;
  }
  s = s - a[l].x * (l - 1) + b[l - 1];
  h = min(s / l, A - a[l].x);
  for (int j = 1; j <= l; j++) a[j].x = a[l].x + h;
  for (int j = i + 1; j <= n; j++) a[j].x = A;
  sort(a + 1, a + n + 1, cmp2);
  for (int j = 1; j <= n; j++) printf("%I64d ", a[j].x);
}
