#include <bits/stdc++.h>
using namespace std;
template <typename TH>
void _dbg(const char* sdbg, TH h) {
  cerr << sdbg << " = " << h << "\n";
}
template <typename TH, typename... TA>
void _dbg(const char* sdbg, TH h, TA... t) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << " = " << h << ",";
  _dbg(sdbg + 1, t...);
}
const int N = 1e5 + 5;
const int64_t LINF = 2e18;
int n;
int64_t A, cf, cm, m, f[N], g[N];
pair<int64_t, int> a[N];
int64_t b[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }
  int64_t ans = -LINF;
  sort(a + 1, a + 1 + n);
  f[1] = a[1].first;
  g[1] = a[1].first;
  for (int i = 1; i <= n; ++i) {
    f[i] = min(f[i - 1], a[i].first);
    g[i] = g[i - 1] + a[i].first;
  }
  int64_t sum = 0;
  int i = n;
  int64_t nMaxBest = 0, minValBest = 0;
  for (int nMax = 0; nMax <= n; ++nMax) {
    int64_t costMax = A * nMax - sum;
    if (costMax <= m) {
      if (nMax == n) {
        int64_t tmp = cf * nMax + cm * A;
        if (ans < tmp) {
          ans = tmp;
          nMaxBest = nMax;
          minValBest = A;
        }
        continue;
      }
      int64_t lo = f[i], hi = A, minVal = -1;
      while (lo <= hi) {
        int64_t mi = (lo + hi) / 2;
        int64_t pos = lower_bound(a + 1, a + 1 + i, make_pair(mi, 0)) - a - 1;
        if (mi * pos - g[pos] + costMax <= m) {
          minVal = mi;
          lo = mi + 1;
        } else {
          hi = mi - 1;
        }
      }
      if (~minVal) {
        int64_t tmp = cf * nMax + cm * minVal;
        if (tmp > ans) {
          ans = tmp;
          nMaxBest = nMax;
          minValBest = minVal;
        }
      }
    }
    sum += a[i].first;
    i--;
  }
  cout << ans << '\n';
  for (int i = n; i >= n - nMaxBest + 1; --i) {
    a[i].first = A;
  }
  for (int i = 1; i <= n; ++i) {
    a[i].first = max(a[i].first, minValBest);
    b[a[i].second] = a[i].first;
  }
  for (int i = 1; i <= n; ++i) {
    cout << b[i] << ' ';
  }
  return 0;
}
