#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n, mx, cf, cm, m;
  cin >> n >> mx >> cf >> cm >> m;
  vector<long long> ar(n);
  vector<pair<long long, long long>> br(n);
  vector<long long> ans;
  for (long long i = 0; i < n; i++) cin >> ar[i], br[i] = {ar[i], i};
  long long rem = m;
  bool f = true;
  for (long long i = 0; i < n; i++) {
    if (rem < mx - ar[i]) f = false;
    rem -= mx - ar[i];
  }
  if (f) {
    cout << cf * n + cm * mx << "\n";
    for (long long i = 0; i < n; i++) cout << mx << " ";
    cout << "\n";
    return 0;
  }
  rem = m;
  ans = ar;
  sort(br.begin(), br.end());
  sort(ar.begin(), ar.end());
  rem = m;
  long long fullp = n;
  long long min_el = 0;
  long long lptr = -1;
  long long fans = 0;
  for (long long i = n - 1; i >= 0; i--) {
    if (mx - ar[i] <= rem) {
      rem -= mx - ar[i];
      fullp = i;
    }
  }
  long long ans_at_mini;
  while (fullp <= n) {
    while (lptr + 1 < fullp and
           (((lptr + 1) * (ar[lptr + 1] - min_el)) <= rem)) {
      lptr++;
      rem -= (lptr) * (ar[lptr] - min_el);
      min_el = ar[lptr];
    }
    min_el += rem / (lptr + 1);
    rem %= (lptr + 1);
    long long val = cf * (n - fullp) + cm * (min_el);
    if (val > fans) {
      fans = val;
      ans_at_mini = min_el;
    }
    if (fullp < n) rem += mx - ar[fullp];
    fullp++;
  }
  rem = m;
  for (long long i = 0; i < n; i++) {
    if (br[i].first < ans_at_mini and ans_at_mini - br[i].first <= m) {
      ans[br[i].second] += ans_at_mini - br[i].first;
      m -= ans_at_mini - br[i].first;
      br[i].first = ans_at_mini;
    }
  }
  for (long long i = n - 1; i >= 0; i--) {
    if (mx - br[i].first <= m) {
      m -= mx - br[i].first;
      ans[br[i].second] += mx - br[i].first;
      br[i].first = mx;
    }
  }
  cout << fans << "\n";
  for (long long x : ans) cout << x << " ";
  cout << "\n";
  return 0;
}
