#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e5 + 100;
long long ans[MAXN], cf, cm, A, n, m, pre[MAXN];
pair<long long, long long> a[MAXN];
long long need(long long m, long long sz) {
  if (sz == 0) return 0;
  long long pos =
      upper_bound(a, a + sz, pair<long long, long long>(m, -1LLu / 8)) - a;
  return m * pos - pre[pos];
}
int main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  cin >> n >> A >> cf >> cm >> m;
  for (long long i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a, a + n);
  pre[0] = 0;
  for (long long i = 0; i < n; i++) pre[i + 1] = pre[i] + a[i].first;
  pair<long long, long long> bu(0, a[0].first);
  long long val = -1, mm;
  for (long long i = n; i >= 0; i--) {
    if (i != n) m -= A - a[i].first;
    if (m < 0) break;
    long long cur, cnt, l, r;
    if (i == 0)
      cur = n * cf + A * cm, cnt = n, mm = A;
    else {
      l = a[0].first, r = A + 1;
      while (l + 1 < r) {
        long long mid = (l + r) / 2;
        if (need(mid, i) <= m)
          l = mid;
        else
          r = mid;
      }
      cur = (n - i) * cf;
      mm = l;
      cur += mm * cm;
    }
    if (cur > val) {
      val = cur;
      bu = pair<long long, long long>(mm, i);
    }
  }
  cout << val << "\n";
  for (long long i = 0; i < n; i++)
    if (a[i].first < bu.first) a[i].first = bu.first;
  for (long long i = bu.second; i < n; i++) a[i].first = A;
  for (long long i = 0; i < n; i++) ans[a[i].second] = a[i].first;
  for (long long i = 0; i < n; i++) cout << ans[i] << " ";
}
