#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const long long INF = 0x3f3f3f3f3f3f3f3f;
const long long llinf = LLONG_MAX;
const int inf = INT_MAX;
const int nmax = 1e5 + 5;
const int mod = 1e9 + 7;
using namespace std;
pair<long long, int> A[nmax];
long long s[nmax], B[nmax], n, a, c, f, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cerr.tie(0);
  cout.tie(0);
  cin >> n >> a >> c >> f >> m;
  for (int i = 0; i < n; ++i) cin >> B[i], A[i] = {B[i], i};
  sort(A, A + n);
  for (int i = 0; i < n; ++i) s[i + 1] = s[i] + A[i].first;
  long long ans = -1, ansi = -1, ansm = -1;
  for (int i = 0, j = 0; i <= n; ++i) {
    long long d = a * (n - i) - (s[n] - s[i]);
    if (d > m) continue;
    long long tmp = c * (n - i);
    long long l = m - d;
    while (j < i && (j * A[j].first - s[j] <= l)) ++j;
    long long mn = j ? min(a, (l + s[j]) / j) : a;
    tmp += mn * f;
    if (tmp > ans) {
      ans = tmp;
      ansi = i;
      ansm = mn;
    }
  }
  cout << ans << endl;
  for (int i = 0; i < n; ++i)
    B[A[i].second] =
        i >= ansi ? a : B[A[i].second] + max(0LL, ansm - B[A[i].second]);
  for (int i = 0; i < n; i++) cout << B[i] << " ";
  cout << endl;
  return 0;
}
