#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A, CF, CM;
  long long M;
  scanf("%d%d%d%d%I64d", &N, &A, &CF, &CM, &M);
  pair<long long, long long> T[N];
  long long SS = 0;
  for (int i = 0; i < N; i++) {
    scanf("%d", &T[i].first);
    SS += T[i].first;
    T[i].second = i;
  }
  if ((long long)A * (long long)N - SS <= M) {
    cout << (long long)N * CF + (long long)A * CM << endl;
    for (int i = 0; i < N; i++) cout << A << " ";
    cout << endl;
    return 0;
  }
  sort(T, T + N);
  long long L[N];
  L[0] = 0;
  for (int i = 1; i < N; i++) {
    L[i] = L[i - 1] + (long long)i * (T[i].first - T[i - 1].first);
  }
  int bi = -1;
  long long bv = 0;
  long long H = 0;
  long long lb = -1;
  long long lc = -1;
  for (int i = N; i >= 0; i--) {
    long long v;
    if (i != N) H += A - T[i].first;
    long long S = M - H;
    if (S < 0) break;
    v = (long long)(N - i) * CF;
    int j = upper_bound(L, L + N, S) - L;
    j--;
    j = min(j, i - 1);
    long long l = 0;
    S -= L[j];
    l = T[j].first;
    l += (S / (j + 1));
    v += (long long)l * CM;
    if (v > bv) {
      bv = v;
      bi = i;
      lb = l;
      lc = j + 1;
    }
  }
  if (bi != -1) {
    for (int i = 1; i <= (N - bi); i++) {
      T[N - i].first = A;
    }
    for (int i = 0; i < lc; i++) {
      T[i].first = max(T[i].first, lb);
    }
  }
  for (int i = 0; i < N; i++) {
    swap(T[i].first, T[i].second);
  }
  sort(T, T + N);
  cout << bv << endl;
  for (int i = 0; i < N; i++) {
    cout << T[i].second << " ";
  }
  cout << endl;
}
