#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using D = double;
using uint = unsigned int;
const int maxn = 100005;
const ll inf = 1e18;
pair<int, int> a[maxn];
int n;
int cf, cm;
int A;
ll M;
int ans[maxn];
int main() {
  scanf(
      "%d%d%d%d"
      "%lld",
      &n, &A, &cf, &cm, &M);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i].first);
    a[i].second = i;
  }
  sort(a, a + n);
  ll needfull = (ll)A * n;
  for (int i = 0; i < n; i++) {
    needfull -= a[i].first;
  }
  if (needfull <= M) {
    printf(
        "%lld"
        "\n",
        (ll)n * cf + (ll)cm * A);
    for (int i = 0; i < n; i++) printf("%d ", A);
    printf("\n");
    return 0;
  }
  ll curlvl = 0;
  int cur = 0;
  ll cursum = 0;
  pair<ll, pair<ll, ll>> result = {-1, {-1, -1}};
  for (int i = 0; i <= n; i++) {
    if (needfull <= M) {
      result = max(result, {(ll)cf * (n - i) + (ll)cm * curlvl, {i, curlvl}});
    }
    if (i == n) break;
    needfull -= (A - a[i].first);
    ll have = M - needfull;
    while (true) {
      ll minstop = inf;
      if (cur > 0) minstop = min(minstop, curlvl + (have - cursum) / cur);
      if (cur <= i) minstop = min(minstop, (ll)a[cur].first);
      if (minstop == inf ||
          (minstop <= curlvl && !(cur <= i && a[cur].first == minstop)))
        break;
      minstop = min(minstop, (ll)A);
      cursum += cur * (minstop - curlvl);
      curlvl = minstop;
      while (cur <= i && a[cur].first <= curlvl) cur++;
    }
  }
  printf(
      "%lld"
      "\n",
      result.first);
  for (int i = 0; i < n; i++) ans[a[i].second] = a[i].first;
  for (int i = 0; i < n; i++)
    if (a[i].first <= result.second.second)
      ans[a[i].second] = result.second.second;
  for (int i = result.second.first; i < n; i++) ans[a[i].second] = A;
  for (int i = 0; i < n; i++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
