#include <bits/stdc++.h>
using namespace std;
long long n, A, cf, cm, m;
pair<long long, long long> a[100100];
long long acc[100100], out, cmx, mni, b[100100];
inline bool ok(long long mn) {
  if (a[0].first >= mn) return 1;
  int j = upper_bound(a, a + n, pair<long long, long long>(mn, 1e18)) - a - 1;
  return (j + 1) * mn - acc[j] <= m;
}
int main() {
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &a[i].first);
    a[i].second = i;
    b[i] = a[i].first;
  }
  sort(a, a + n);
  a[n] = pair<long long, long long>(A, -1);
  acc[0] = a[0].first;
  for (int i = 1; i < n; i++) acc[i] = acc[i - 1] + a[i].first;
  for (int i = n; i >= 0; i--) {
    m -= A - a[i].first;
    if (m < 0) break;
    a[i].first = A;
    long long s = 0, e = A, md, bst = 0;
    while (s <= e) {
      md = s + ((e - s) >> 1);
      if (ok(md))
        s = md + 1, bst = md;
      else
        e = md - 1;
    }
    if (out < (n - i) * cf + bst * cm) {
      out = (n - i) * cf + bst * cm;
      cmx = (n - i);
      mni = bst;
    }
  }
  cout << out << endl;
  for (int j = n - 1, cc = 0; cc < cmx; j--, cc++) b[a[j].second] = A;
  for (int i = 0; i < n; ++i) b[i] = max(b[i], mni);
  for (int i = 0; i < n; ++i) {
    printf("%lld ", b[i]);
  }
}
