#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
int n;
long long A, cf, fm, m;
pair<long long, int> a[N];
long long suf[N];
long long b[N];
void solve() {
  ios::sync_with_stdio(false);
  cin >> n >> A >> cf >> fm >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i].first;
    b[i] = a[i].first;
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  for (int i = n; i >= 1; --i) {
    suf[i] = suf[i + 1] + a[i].first;
  }
  long long ans = -1;
  int fA, lA, value;
  for (int i = 0; i <= n; ++i) {
    if (m < 0) break;
    long long cur = i * cf;
    if (i == n) {
      if (ans < cur + A * fm) {
        ans = cur + A * fm;
        fA = n;
        lA = n + 1;
        value = 0;
      }
      break;
    }
    long long l = i, r = n + 1, mid;
    for (; l + 1 < r;) {
      mid = (l + r) / 2;
      long long cst = a[mid].first * (n - mid + 1) - suf[mid];
      if (m >= cst) {
        r = mid;
      } else {
        l = mid;
      }
    }
    long long lft = m - a[r].first * (n - r + 1) + suf[r];
    if (ans < cur + min(A, a[r].first + lft / (n - r + 1)) * fm) {
      ans = cur + min(A, a[r].first + lft / (n - r + 1)) * fm;
      fA = i;
      lA = r;
      value = min(A, a[r].first + lft / (n - r + 1));
    }
    m -= A - a[i + 1].first;
  }
  cout << ans << endl;
  for (int i = lA; i <= n; ++i) {
    b[a[i].second] = value;
  }
  for (int i = 1; i <= fA; ++i) {
    b[a[i].second] = A;
  }
  for (int i = 1; i <= n; ++i) {
    cout << b[i] << ' ';
  }
  cout << endl;
}
int main() {
  solve();
  return 0;
}
