#include <bits/stdc++.h>
using namespace std;
map<long long, long long> st;
map<long long, long long>::iterator it, it1;
long long x[100100];
pair<long long, long long> x1[100100];
long long del[100100];
int main() {
  long long n, a, cf, cm, m;
  cin >> n >> a >> cf >> cm >> m;
  long long m1 = m;
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &x[i]);
    x1[i].first = x[i];
    x1[i].second = i;
  }
  sort(x1, x1 + n);
  reverse(x1, x1 + n);
  int in = n;
  for (int i = 0; i < n; i++) {
    if (m >= a - x1[i].first) {
      m -= a - x1[i].first;
      x1[i].first = a;
    } else {
      x1[i].first += m;
      in = i;
      m = 0;
      break;
    }
  }
  for (int i = 0; i < n; i++) {
    st[x1[i].first]++;
  }
  long long res = x1[n - 1].first * cm + cf * st[a];
  int in1 = in;
  int mn = st.begin()->first;
  for (int i = min(in, (int)n - 1); i >= 0; i--) {
    st[x[x1[i].second]]++;
    st[x1[i].first]--;
    m += x1[i].first - x[x1[i].second];
    while (st.size() >= 2 && m > 0) {
      it = st.begin();
      if (it->second == 0) {
        st.erase(it);
        continue;
      }
      it1 = it;
      it1++;
      if (it1->second == 0) {
        st.erase(it1);
        continue;
      }
      if ((it1->first - it->first) * it->second <= m) {
        m -= (it1->first - it->first) * it->second;
        it1->second += it->second;
        it->second = 0;
      } else {
        long long t = m / it->second;
        long long t1 = m % (it->second);
        long long z = it->second;
        it->second = 0;
        if (!t1) {
          st[it->first + t] += z;
        } else {
          st[it->first + t] += z - t1;
          st[it->first + t + 1] += t1;
        }
        m = 0;
      }
    }
    while (st.begin()->second == 0) st.erase(st.begin());
    long long r = (st.begin()->first) * cm + cf * st[a];
    if (res < r) {
      in1 = st[a];
      res = r;
      mn = st.begin()->first;
    }
  }
  m = m1;
  cout << res << endl;
  for (int i = 0; i < in1; i++) {
    m -= a - x[x1[i].second];
    x[x1[i].second] = a;
  }
  for (int i = 0; i < n; i++) {
    if (x[i] < mn) x[i] = mn;
  }
  for (int i = 0; i < n; i++) {
    printf("%I64d ", x[i]);
  }
  return 0;
}
