#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
long long M, curM;
map<int, int> mp;
set<pair<int, int> > S;
map<int, int>::iterator itaux;
int N, A, V[MAXN];
int curA, pos[MAXN];
long long maxA, maxMin, maxV, Cf, Cm;
bool cmp(const int i, const int j) { return V[i] < V[j]; }
void check(int curA) {
  long long value = S.begin()->first;
  long long amount = S.begin()->second;
  long long nxtValue = (++S.begin())->first;
  long long nxtAmount = (++S.begin())->second;
  long long req = (nxtValue - value) * amount;
  while (curM >= req) {
    curM -= req;
    mp[(++S.begin())->first] = 0;
    S.erase(++S.begin());
    mp[S.begin()->first] = 0;
    S.erase(S.begin());
    mp[nxtValue] = nxtAmount + amount;
    S.insert({nxtValue, nxtAmount + amount});
    value = S.begin()->first;
    amount = S.begin()->second;
    nxtValue = (++S.begin())->first;
    nxtAmount = (++S.begin())->second;
    req = (nxtValue - value) * amount;
  }
  nxtValue = value + curM / amount;
  curM = curM % amount;
  mp[S.begin()->first] = 0;
  S.erase(S.begin());
  mp[nxtValue] = amount;
  S.insert({nxtValue, amount});
  int curMin = S.begin()->first;
  if (curMin * Cm + (N - curA - 1) * Cf > maxV) {
    maxMin = curMin;
    maxA = N - curA - 1;
    maxV = curMin * Cm + (N - curA - 1) * Cf;
  }
}
int main() {
  scanf("%d", &N), scanf("%d", &A);
  scanf("%lld", &Cf), scanf("%lld", &Cm);
  scanf("%lld", &M);
  for (int i = 0; i < (int)N; i++) scanf("%d", &V[i]);
  for (int i = 0; i < (int)N; i++) pos[i] = i;
  sort(pos, pos + N, cmp);
  curA = N - 1, curM = M;
  while (curA >= 0) {
    int idx = pos[curA];
    if (A - V[idx] <= curM) {
      curM -= A - V[idx];
      curA--;
    } else {
      break;
    }
  }
  curA++;
  for (int i = 0; i < (int)curA; i++) {
    int idx = pos[i];
    mp[V[idx]]++;
  }
  if (curA == 0) {
    printf("%lld\n", N * Cf + A * Cm);
    for (int i = 0; i < (int)N; i++) printf("%d ", A);
    printf("\n");
    return 0;
  }
  maxA = N - curA;
  maxMin = mp.begin()->first;
  maxV = maxA * Cf + maxMin * Cm;
  for (itaux = mp.begin(); itaux != mp.end(); itaux++)
    S.insert({itaux->first, itaux->second});
  S.insert({A, maxA});
  mp[A] = maxA;
  check(curA - 1);
  for (int cur = curA; cur < (int)N; cur++) {
    int idx = pos[cur];
    S.erase(*S.rend());
    mp[A]--;
    S.insert({A, mp[A]});
    if (V[idx] > S.begin()->first) {
      curM += A - V[idx];
      if (mp[V[idx]] > 0) {
        pair<int, int> p = *S.find({V[idx], mp[V[idx]]});
        S.erase(p);
        p.second++;
        S.insert(p);
      } else {
        S.insert({V[idx], 1});
      }
      mp[V[idx]]++;
    } else {
      pair<int, int> p = *S.begin();
      S.erase(S.begin());
      p.second++;
      S.insert(p);
      curM += A - S.begin()->first;
      mp[p.first] = p.second;
    }
    check(cur);
  }
  printf("%lld\n", maxV);
  for (int i = N - maxA; i < (int)N; i++) {
    int idx = pos[i];
    V[idx] = A;
  }
  for (int i = 0; i < (int)N; i++)
    printf("%lld ", max(maxMin, (long long)V[i]));
  printf("\n");
}
