#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
const long double PI(acos(-1.0));
using namespace std;
const int N = 1 << 19;
long long n, A, cmin, cA, m;
pair<long long, long long> a[N];
long long v[N];
long long get(int r, long long sum, bool fl) {
  sum -= a[r].first * (r + 1ll) - v[r];
  long long curmin = a[r].first;
  if (sum >= 0) {
    long long canadd = sum / (r + 1ll);
    curmin = min(curmin + canadd, ((r == n - 1 || fl) ? A : a[r + 1].first));
    return curmin * cmin;
  } else
    return -1;
}
struct node {
  int l;
  long long score;
  node() : l(-1), score(-1) {}
  node(int l, long long score) : l(l), score(score) {}
};
node nd[N];
int main() {
  cout.precision(10);
  srand(unsigned(time(nullptr)));
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  scanf("%I64d%I64d%I64d%I64d%I64d", &n, &A, &cA, &cmin, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%I64d", &a[i].first);
    a[i].second = i;
  }
  sort(a, a + n);
  v[0] = a[0].first;
  for (int i = 1; i < n; ++i) v[i] = v[i - 1] + a[i].first;
  if (A * n - v[n - 1] <= m) {
    printf("%I64d\n", n * cA + A * cmin);
    for (int i = 0; i < n; ++i) printf("%I64d ", A);
    return 0;
  }
  int l = 0, r = 0;
  while (r < n && a[r].first < A) ++r;
  l = r - 1;
  while (l >= 0 && get(l, m, 0) == -1) --l;
  nd[r] = node(l, (n - r) * cA + get(l, m, 0));
  --r;
  for (; r; --r) {
    m -= A - a[r].first;
    if (m < 0) break;
    while (l >= r) --l;
    bool fl = true;
    while (l >= 0 && get(l, m, 0) == -1) --l, fl = false;
    nd[r] = node(l, cA * (n - r) + get(l, m, fl));
  }
  long long mx = -1, idx = -1;
  for (int i = 0; i <= n; ++i) {
    if (nd[i].score > mx) {
      mx = nd[i].score;
      idx = i;
    }
  }
  printf("%I64d\n", nd[idx].score);
  long long mn;
  if (cmin)
    mn = (nd[idx].score - (n - idx) * cA) / cmin;
  else
    mn = a[idx].first;
  for (long long i = 0; i <= nd[idx].l && cmin; ++i) a[i].first = mn;
  for (long long i = idx; i < n && cA; ++i) a[i].first = A;
  for (int i = 0; i < n; ++i) v[a[i].second] = a[i].first;
  for (int i = 0; i < n; ++i) printf("%I64d ", v[i]);
}
