#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100001;
long long n, a, cf, cm, m, ach[MAX_N], reach[MAX_N], ans;
pair<long long, int> skill[MAX_N];
int getBestReach(int last, long long rem) {
  int l = 0, r = last, ret = 0;
  while (l + 3 < r) {
    int mid = (l + r) / 2;
    if (reach[mid] <= rem) {
      ret = max(ret, mid);
      l = mid;
    } else
      r = mid;
  }
  for (; l <= r; l++)
    if (reach[l] <= rem) ret = max(ret, l);
  return ret;
}
bool cmp(pair<int, int> a, pair<int, int> b) { return a.second < b.second; }
int main() {
  scanf("%lld%lld%lld%lld%lld", &n, &a, &cf, &cm, &m);
  for (int i = 0; i < n; i++)
    scanf("%lld", &skill[i].first), skill[i].second = i;
  sort(skill, skill + n);
  for (int i = n - 1; i >= 0; i--) ach[i] = ach[i + 1] + a - skill[i].first;
  for (int i = 0; i < n; i++)
    reach[i] =
        reach[i - 1] + (skill[i].first - skill[i - 1].first) * (long long)i;
  long long reachLeft = n, reachRight = -1, valOfrr;
  for (int i = n; i >= 0; i--) {
    long long tempM = m - ach[i];
    if (tempM < 0) break;
    if (i == 0) {
      reachRight = -1;
      reachLeft = 0;
      ans = a * cm + n * cf;
    }
    int ind = getBestReach(i - 1, tempM);
    ind++;
    long long tmp =
        min(a, (skill[ind - 1].first + (tempM - reach[ind - 1]) / ind)) * cm +
        (n - (long long)i) * cf;
    if (tmp > ans) {
      ans = tmp;
      reachLeft = i;
      reachRight = ind - 1;
      valOfrr = min(a, (skill[ind - 1].first + (tempM - reach[ind - 1]) / ind));
    }
  }
  for (int i = 0; i <= reachRight; i++) skill[i].first = valOfrr;
  for (int i = n - 1; i >= reachLeft; i--) skill[i].first = a;
  sort(skill, skill + n, cmp);
  printf("%lld\n", ans);
  for (int i = 0; i < n; i++) printf("%lld ", skill[i].first);
  return 0;
}
