#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
long long n, m, A, cf, cm, pos, tmp, tnp, ans, bns, cns;
long long b[N], c[N];
struct Arr {
  long long val, idx;
} a[N];
bool cmp(Arr A, Arr B) {
  if (A.val == B.val) return A.idx < B.idx;
  return A.val < B.val;
}
bool dmp(Arr A, Arr B) { return A.idx < B.idx; }
signed main() {
  scanf("%lld%lld%lld%lld%lld", &n, &A, &cf, &cm, &m);
  for (long long i = 1; i <= n; ++i) {
    scanf("%lld", &a[i].val);
    a[i].idx = i;
  }
  sort(a + 1, a + n + 1, cmp);
  for (long long i = 1; i <= n; ++i) {
    b[i] = b[i - 1] + a[i].val;
    c[i] = a[i].val * i - b[i];
  }
  for (long long i = 0; i < n; ++i) {
    if (m < 0) break;
    pos = upper_bound(c + 1, c + (n - i) + 1, m) - c - 1;
    tmp = min((m - c[pos]) / pos + a[pos].val, A);
    tnp = i * cf + tmp * cm;
    if (tnp > ans) {
      ans = tnp;
      bns = tmp;
      cns = i;
    }
    m = m - (A - a[n - i].val);
  }
  if (m >= 0) ans = n * cf + A * cm;
  for (long long i = 1; i <= n; ++i) {
    if (n - i < cns)
      a[i].val = A;
    else if (a[i].val <= bns)
      a[i].val = bns;
  }
  sort(a + 1, a + n + 1, dmp);
  printf("%lld\n", ans);
  for (long long i = 1; i < n; ++i) printf("%lld ", a[i].val);
  printf("%d\n", a[n].val);
  return 0;
}
