#include <bits/stdc++.h>
using namespace std;
const int inft = 1000000009;
const int MAXN = 1000006;
long long ja[MAXN];
int T[MAXN];
pair<int, int> TT[MAXN];
int main() {
  int n, A, cf, cm;
  long long m;
  scanf("%d%d%d%d%lld", &n, &A, &cf, &cm, &m);
  for (int i = 0; i < (n); ++i) scanf("%d", &TT[i].first);
  for (int i = 0; i < (n); ++i) TT[i].second = i;
  sort(TT, TT + n);
  for (int i = 0; i < (n); ++i) T[i] = TT[i].first;
  for (int i = 1; i < n; ++i) ja[i] = ja[i - 1] + 1LL * (T[i] - T[i - 1]) * i;
  long long ret = -1;
  int jak = -1, dol = -1;
  for (int i = 0; i < (n + 1); ++i) {
    if (i) m -= A - T[n - i];
    if (m < 0) break;
    int p = 0, k = n - i;
    while (p + 1 < k) {
      int c = (p + k) / 2;
      if (ja[c] <= m)
        p = c;
      else
        k = c;
    }
    int mali = 0;
    if (p < k) {
      mali = T[p];
      long long m2 = m - ja[p];
      assert(m2 >= 0);
      ;
      mali += min(m2 / (p + 1), 1LL * A - T[p]);
    } else
      mali = A;
    long long q = 1LL * i * cf + 1LL * mali * cm;
    ;
    if (q > ret) {
      ret = q;
      jak = i;
      dol = mali;
    }
  }
  assert(dol != -1);
  printf("%lld\n", ret);
  for (int i = 0; i < (jak); ++i) TT[n - i - 1].first = A;
  for (int i = 0; i < (n); ++i) TT[i].first = max(TT[i].first, dol);
  for (int i = 0; i < (n); ++i) swap(TT[i].first, TT[i].second);
  sort(TT, TT + n);
  for (int i = 0; i < (n); ++i) printf("%d ", TT[i].second);
  printf("\n");
  return 0;
}
