#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > v;
vector<long long> cum;
long long n, a;
long long pos(long long st, long long ed, long long rem) {
  long long l = 0, h = max(v[st].first, a), m, pos = n + 1, res = 0;
  while (h >= l) {
    long long mn = st, mx = ed, mid;
    m = (h + l) / 2;
    while (mn <= mx) {
      mid = (mn + mx) / 2;
      if (v[mid].first <= m) {
        pos = mid;
        mx = mid - 1;
      } else
        mn = mid + 1;
    }
    long long need = (n - pos + 1) * m - cum[pos];
    if (need <= rem) {
      res = m;
      l = m + 1;
    } else
      h = m - 1;
  }
  return res;
}
int main() {
  long long i, cf, cm, m;
  cin >> n >> a >> cf >> cm >> m;
  v.resize(n + 1);
  cum.resize(n + 2);
  for (i = 1; i <= n; i++) {
    cin >> v[i].first;
    v[i].second = i;
  }
  sort(v.begin() + 1, v.end());
  reverse(v.begin() + 1, v.end());
  for (i = n; i >= 0; i--) cum[i] = cum[i + 1] + v[i].first;
  long long need = 0, ans = 0, mx, mn;
  for (i = 0; i <= n; i++) {
    if (i) need += (a - v[i].first);
    long long rem = m - need;
    if (rem < 0) continue;
    long long res, res2;
    if (i == n)
      res = i * cf + a * cm, res2 = 1;
    else {
      res2 = pos(i + 1, n, rem);
      res = i * cf + res2 * cm;
    }
    if (ans <= res) {
      mx = i, mn = res2;
      ans = max(ans, res);
    }
  }
  for (i = 1; i <= n; i++) {
    if (mx) {
      v[i].first = a;
      mx--;
    } else if (v[i].first < mn)
      v[i].first = mn;
  }
  cout << ans << endl;
  vector<long long> ansi(n + 1);
  for (i = 1; i <= n; i++) ansi[v[i].second] = v[i].first;
  for (i = 1; i <= n; i++) cout << ansi[i] << ' ';
  return 0;
}
