#include <bits/stdc++.h>
using namespace std;
inline long long tavan(long long a, long long n, long long mod) {
  long long p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
      p %= mod;
    }
    n >>= 1;
    a *= a;
    a %= mod;
  }
  return p % mod;
}
long long n, A, cf, cm, m, b[(101 * 1000)], ans = -1;
pair<long long, long long> id, a[(101 * 1000)];
set<pair<long long, long long> > s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 0; i < n; i++) cin >> a[i].first, a[i].second = i;
  sort(a, a + n);
  for (long long i = 0, sum = 0; i < n; i++)
    s.insert({a[i].first, i}), b[i] = a[i].first * i - sum, sum += a[i].first;
  a[n].first = a[n + 1].first = A;
  for (long long i = n; i >= 0; i--) {
    m -= A - a[i].first;
    if (m < 0) break;
    long long l = 0, r = A;
    while (l < r - 1) {
      long long mid = (l + r) / 2;
      set<pair<long long, long long> >::iterator it =
          s.upper_bound({min(mid, a[i - 1].first), i - 1});
      if (it == s.begin()) {
        l = mid;
        continue;
      }
      it--;
      if (m >= b[it->second] + (mid - it->first) * (it->second + 1))
        l = mid;
      else
        r = mid;
    }
    if (ans < cf * (n - i) + cm * l) ans = cf * (n - i) + cm * l, id = {i, l};
    if (!i && ans < cf * n + cm * A) ans = cf * n + cm * A, id = {i, l};
  }
  cout << ans << "\n";
  for (int i = n - 1; i >= id.first; i--) a[i].first = A;
  for (int i = 0; i < n; i++) b[a[i].second] = max(a[i].first, id.second);
  for (int i = 0; i < n; i++) cout << b[i] << " ";
  return 0;
}
