#include <bits/stdc++.h>
using namespace std;
int N;
long long A, cf, cm, m;
pair<long long, int> a[100009];
int getInd(long long k) {
  int L = 0, R = N - 1;
  int B = N;
  while (L <= R) {
    int M = (L + R) / 2;
    if (a[M].first < k) {
      B = M;
      R = M - 1;
    } else {
      L = M + 1;
    }
  }
  return B;
}
long long prefSum[100009];
long long suffSum[100009];
long long b[100009];
int main() {
  ios::sync_with_stdio(false);
  cin >> N >> A >> cf >> cm >> m;
  for (int i = 0; i < N; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a, a + N, std::greater<pair<long long, int> >());
  prefSum[0] = a[0].first;
  for (int i = 1; i < N; i++) prefSum[i] = prefSum[i - 1] + a[i].first;
  suffSum[N - 1] = a[N - 1].first;
  for (int i = N - 2; i >= 0; i--) suffSum[i] = suffSum[i + 1] + a[i].first;
  long long ans = 0;
  int ans_info1 = 0;
  long long ans_info2 = 0;
  for (int maxCnt = 0; maxCnt <= N; maxCnt++) {
    long long L = 0, R = A;
    while (L <= R) {
      long long M = (L + R) / 2;
      int ind = getInd(M);
      ind = max(maxCnt, ind);
      if (A * maxCnt - (maxCnt ? prefSum[maxCnt - 1] : 0) + (N - ind) * M -
              suffSum[ind] <=
          m) {
        long long tmpAns = maxCnt * cf + M * cm;
        if (tmpAns > ans) {
          ans = tmpAns;
          ans_info1 = maxCnt;
          ans_info2 = M;
        }
        L = M + 1;
      } else {
        R = M - 1;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    if (i < ans_info1) a[i].first = A;
    if (a[i].first < ans_info2) a[i].first = ans_info2;
    b[a[i].second] = a[i].first;
  }
  cout << ans << endl;
  for (int i = 0; i < N; i++) cout << b[i] << " ";
}
