#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
long long n, A, cf, cm, m, skill;
long long ans[N];
long long presum[N];
vector<pair<long long, int> > S;
long long bin(int pos) {
  long long l, r, mid, ret;
  l = 0, r = A;
  ret = 0;
  while (l <= r) {
    mid = l + (r - l) / 2;
    int justgreater =
        upper_bound(&S[0], &S[pos + 1], make_pair(mid, -1)) - &S[0];
    if ((justgreater * mid - (presum[justgreater] - S[justgreater].first)) <=
        m) {
      ret = max(ret, mid);
      l = mid + 1;
    } else
      r = mid - 1;
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 0; i < n; i++) {
    cin >> skill;
    S.push_back({skill, i});
  }
  sort(S.begin(), S.end());
  S.push_back({A, 0});
  presum[0] = S[0].first;
  for (int i = 1; i <= n; i++) presum[i] = presum[i - 1] + S[i].first;
  long long mx = -1, mxm;
  int mxpos;
  for (int i = n; i >= 0; i--) {
    if (m < A - S[i].first) break;
    m -= A - S[i].first;
    long long temp = cf * (n - i) + cm * bin(i - 1);
    if (temp > mx) {
      mx = temp;
      mxpos = i - 1;
      mxm = m;
    }
  }
  m = mxm;
  long long maxmin = bin(mxpos);
  for (int i = n - 1; i > mxpos; i--) S[i].first = A;
  for (int i = 0; i < n; i++) {
    if (S[i].first < maxmin) S[i].first = maxmin;
    ans[S[i].second] = S[i].first;
  }
  cout << mx << endl;
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  cout << "\n";
  return 0;
}
