#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long n, maxlvl, cf, cm, m, niza[100001], sum[100001], result, to, val;
  pair<int, int> parovi[100001];
  result = 0;
  cin >> n >> maxlvl >> cf >> cm >> m;
  for (int i = 0; i < n; i++) {
    cin >> niza[i];
    parovi[i] = make_pair(niza[i], i);
  }
  to = n;
  val = -1;
  sort(&parovi[0], &parovi[n]);
  sort(&niza[0], &niza[n]);
  for (int i = 0; i < n; i++) {
    if (i == 0)
      sum[i] = niza[i];
    else
      sum[i] = sum[i - 1] + niza[i];
  }
  for (int i = n; i >= 0; i--) {
    if (i < n) m = m - (maxlvl - niza[i]);
    if (m < 0) break;
    if (i == 0) {
      if (result < n * cf + maxlvl * cm) {
        result = n * cf + maxlvl * cm;
        to = i;
        val = 0;
      }
      break;
    }
    long long l = 0;
    long long r = maxlvl;
    while (l <= r) {
      long long midpoint = l + (r - l) / 2;
      long long levo = 0;
      long long desno = i - 1;
      long long best = -1;
      while (levo <= desno) {
        long long sredina = levo + (desno - levo) / 2;
        if (niza[sredina] <= midpoint) {
          levo = sredina + 1;
          best = sredina;
        } else
          desno = sredina - 1;
      }
      if (best == -1) {
        r = midpoint - 1;
        continue;
      }
      long long needed = (niza[best] * (best + 1)) - sum[best];
      needed = needed + (midpoint - niza[best]) * (best + 1);
      if (needed <= m) {
        if ((midpoint * cm + (n - i) * cf) > result) {
          result = midpoint * cm + (n - i) * cf;
          to = i;
          val = midpoint;
        }
        l = midpoint + 1;
      } else
        r = midpoint - 1;
    }
  }
  long long currres = 0;
  long long minn = 1000000000000000;
  for (int i = 0; i < n; i++) {
    if ((i < to) && (parovi[i].first < val)) {
      niza[parovi[i].second] = val;
    } else if ((i < to) && (parovi[i].first >= val)) {
      niza[parovi[i].second] = parovi[i].first;
    } else if (i >= to)
      niza[parovi[i].second] = maxlvl;
    if (niza[parovi[i].second] == maxlvl) currres = currres + cf;
    if (niza[parovi[i].second] < minn) minn = niza[parovi[i].second];
  }
  currres = currres + minn * cm;
  cout << currres << "\n";
  for (int i = 0; i < n; i++) {
    cout << niza[i] << " ";
  }
  return 0;
}
