#include <bits/stdc++.h>
using namespace std;
vector<long long> suff;
pair<int, long long> solve(int n, long long money) {
  int l = 1, r = n;
  while (r - l > 1) {
    int m = (l + r) >> 1;
    long long sum = suff[m];
    long long spend = (suff[m] - suff[m - 1]) * m - sum;
    if (spend > money) {
      r = m;
    } else {
      l = m;
    }
  }
  long long sum = suff[r];
  long long spend = (suff[r] - suff[r - 1]) * r - sum;
  if (spend <= money) {
    return make_pair(r, spend);
  } else {
    sum = suff[l];
    spend = (suff[l] - suff[l - 1]) * l - sum;
    return make_pair(l, spend);
  }
}
int main() {
  int n;
  long long amax, cmax, cmin, m;
  scanf("%d%I64d%I64d%I64d%I64d", &n, &amax, &cmax, &cmin, &m);
  vector<pair<long long, int> > v(n);
  for (int i = 0; i < n; ++i) {
    scanf("%I64d", &v[i].first);
    v[i].second = i;
  }
  sort((v).begin(), (v).end());
  reverse((v).begin(), (v).end());
  vector<long long> pref(n + 1);
  suff.resize(n + 1);
  pref[0] = 0;
  for (int i = 0; i < n; ++i) {
    pref[i + 1] = pref[i] + v[i].first;
  }
  suff[0] = 0;
  for (int i = n - 1; i >= 0; --i) {
    suff[n - i] = suff[n - i - 1] + v[i].first;
  }
  long long ans = -1, cnt = -1;
  for (int i = 0; i <= n; ++i) {
    long long sum = pref[i];
    long long spent = amax * i - sum;
    if (spent > m) {
      continue;
    }
    long long relax = i * cmax;
    if (i == n) {
      relax += amax * cmin;
      if (ans < relax) {
        ans = relax;
        cnt = i;
      }
      continue;
    }
    pair<int, long long> para = solve(n - i, m - spent);
    spent += para.second;
    long long x = suff[para.first] - suff[para.first - 1];
    x += (m - spent) / para.first;
    if (x > amax) {
      x = amax;
    }
    relax += x * cmin;
    if (ans < relax) {
      ans = relax;
      cnt = i;
    }
  }
  printf("%I64d\n", ans);
  m -= (amax * cnt - pref[cnt]);
  for (int i = 0; i < cnt; ++i) {
    v[i].first = amax;
  }
  if (cnt == n) {
    for (int i = 0; i < n; ++i) {
      printf("%I64d ", amax);
    }
    printf("\n");
    return 0;
  }
  pair<int, long long> para = solve(n - cnt, m);
  m -= para.second;
  long long x = suff[para.first] - suff[para.first - 1];
  x += m / para.first;
  if (x > amax) {
    x = amax;
  }
  for (int i = 0; i < para.first; ++i) {
    v[n - i - 1].first = x;
  }
  vector<long long> fin(n);
  for (int i = 0; i < n; ++i) {
    fin[v[i].second] = v[i].first;
  }
  for (int i = 0; i < n; ++i) {
    printf("%I64d ", fin[i]);
  }
  printf("\n");
}
