#include <bits/stdc++.h>
using namespace std;
long long int cumsum[100010];
long long int A, cf, cm, m;
long long check(int idx, vector<long long int>& v, long long int currMin) {
  auto it = upper_bound(v.begin(), v.begin() + idx, currMin);
  int len = (it - v.begin());
  len -= 1;
  if (len < 0) return 0;
  return currMin * (len + 1) - cumsum[len];
}
long long int getMin(int idx, vector<long long int>& v, long long int rem) {
  long long int lo = 0, hi = A;
  while (lo < hi - 1) {
    long long int mid = (lo + hi) >> 1;
    if (check(idx, v, mid) > rem)
      hi = mid - 1;
    else
      lo = mid;
  }
  if (check(idx, v, lo + 1) <= rem)
    return lo + 1;
  else
    return lo;
}
int main() {
  ios_base::sync_with_stdio(false);
  int N;
  cin >> N;
  cin >> A >> cf >> cm >> m;
  vector<pair<long long int, int> > vtmp(N);
  vector<long long> v(N);
  for (int i = 0; i < N; i++) cin >> v[i];
  for (int i = 0; i < N; i++) {
    vtmp[i].first = v[i];
    vtmp[i].second = i;
  }
  sort(v.begin(), v.end());
  sort(vtmp.begin(), vtmp.end());
  cumsum[0] = v[0];
  for (int i = 1; i < N; i++) cumsum[i] = cumsum[i - 1] + v[i];
  long long int cfUsed = 0;
  long long int maxVal = 0;
  long long int alpha = 0, beta = 0;
  for (int nA = 0, idx = N - 1; nA <= N; nA++, idx--) {
    if (cfUsed > m) break;
    long long int currMin = getMin(idx + 1, v, m - cfUsed);
    long long int curr = cf * nA + cm * currMin;
    if (curr > maxVal) {
      maxVal = curr;
      alpha = nA;
      beta = currMin;
    }
    if (idx >= 0) cfUsed += A - v[idx];
  }
  cout << maxVal << endl;
  for (int i = 0; i < N; i++) vtmp[i].first = max(vtmp[i].first, beta);
  for (int i = N - 1, j = 0; j < alpha; j++, i--) vtmp[i].first = A;
  for (int i = 0; i < N; i++) v[vtmp[i].second] = vtmp[i].first;
  for (int i = 0; i < N; i++) cout << v[i] << " ";
  cout << endl;
  return 0;
}
