#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1.5e5;
long long a[MAX], pre[MAX];
long long A;
bool valid(long long idx, long long mn, long long m) {
  long long pos = upper_bound(a, a + idx, mn) - a;
  return m >= (pos * mn - pre[pos]);
}
long long get(long long i, long long m) {
  long long lo = 1, hi = A + 1;
  while (hi - lo > 1) {
    long long mid = (lo + hi) >> 1;
    if (valid(i, mid, m)) {
      lo = mid;
    } else {
      hi = mid;
    }
  }
  return lo;
}
long long nar[MAX];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, cf, cm, m;
  cin >> n >> A >> cf >> cm >> m;
  long long o = n;
  long long fu = 0;
  vector<pair<long long, long long> > sor;
  for (long long i = 0, j = 0; i < n; ++i, ++j) {
    cin >> a[i];
    if (a[i] == A) {
      fu++;
      i--;
      n--;
    } else {
      sor.push_back({a[i], j});
    }
  }
  sort(sor.begin(), sor.end());
  for (long long i = 0; i < n; ++i) {
    a[i] = sor[i].first;
  }
  for (long long i = 1; i <= n; ++i) {
    pre[i] = pre[i - 1] + a[i - 1];
  }
  long long ans = fu * cf + get(n, m) * cm, idx = n;
  for (long long i = n - 1; i >= 0; --i) {
    m -= A - a[i];
    if (m < 0) {
      continue;
    }
    long long nans = (fu + n - i) * cf + cm * get(i, m);
    if (nans > ans) {
      ans = nans;
      idx = i;
    }
  }
  cout << ans << "\n";
  if (cm != 0) {
    ans -= (fu + n - idx) * cf;
    ans /= cm;
  } else {
    ans = 1;
  }
  fill(nar, nar + o, A);
  for (long long i = 0; i < idx; ++i) {
    nar[sor[i].second] = max(ans, a[i]);
  }
  for (long long i = 0; i < o; ++i) {
    cout << nar[i] << " ";
  }
  cout << "\n";
  return 0;
}
