#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, cf, cm, L = maxn, R = -1;
long long A, M, sk[maxn], mn[maxn], ans, meg, nw[maxn];
vector<long long> sm;
pair<int, int> srt[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> A >> cf >> cm >> M;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    srt[i] = make_pair(a, i);
  }
  sort(srt, srt + n);
  for (int i = n - 1; i >= 0; i--) mn[i] = 1ll * (mn[i + 1] + A - srt[i].first);
  sm.push_back(1ll * 0);
  for (int i = 1; i < n; i++)
    sm.push_back(1ll * sm[i - 1] + 1ll * i * (srt[i].first - srt[i - 1].first));
  for (int i = n; i > 0; i--) {
    long long cur = M - mn[i];
    if (cur < 0) break;
    int pl = upper_bound(sm.begin(), sm.begin() + i, cur) - sm.begin() - 1;
    long long ext = (cur - sm[pl]) / (pl + 1);
    if (ans < 1ll * (n - i) * cf + min(srt[pl].first + ext, A) * cm) {
      ans = 1ll * (n - i) * cf + min(srt[pl].first + ext, A) * cm;
      L = i, R = pl, meg = min(A, srt[pl].first + ext);
    }
  }
  if (M >= mn[0]) {
    ans = 1ll * n * cf + 1ll * A * cm;
    L = 0, R = 0;
  }
  for (int i = 0; i < n; i++) nw[i] = srt[i].first;
  for (int i = 0; i <= R; i++) nw[i] = min(A, meg);
  for (int i = L; i < n; i++) nw[i] = A;
  for (int i = 0; i < n; i++) sk[srt[i].second] = nw[i];
  cout << ans << endl;
  for (int i = 0; i < n; i++) cout << sk[i] << ' ';
  cout << endl;
  return 0;
}
