#include <bits/stdc++.h>
using namespace std;
template <class T>
T inline sqr(T x) {
  return x * x;
}
const long double pi = 3.1415926535897932384626433832795;
const long double eps = 1e-8;
int main() {
  ios::sync_with_stdio(false);
  int n, A;
  long long cf, cm, m;
  cin >> n >> A >> cf >> cm >> m;
  vector<pair<int, int> > b(n);
  for (int i = 0; i < (int)(n); ++i) {
    b[i].second = i;
    cin >> b[i].first;
  }
  sort((b).begin(), (b).end());
  vector<int> a(n);
  for (int i = 0; i < (int)(n); ++i) a[i] = b[i].first;
  vector<long long> need(n);
  need[0] = 0;
  for (int i = 0; i < (int)(n - 1); ++i) {
    need[i + 1] = need[i] + (a[i + 1] - a[i]) * (i + 1LL);
  }
  long long s = 0;
  long long ans = -1;
  int blast, ind, val;
  for (int last = n; last >= 0; last--) {
    if (last != n) {
      s += A - a[last];
    }
    if (s > m) break;
    int have = n - last;
    long long x;
    if (!last) {
      x = A;
    } else {
      long long rem = m - s;
      int p =
          upper_bound(need.begin(), need.begin() + last, rem) - need.begin();
      --p;
      rem -= need[p];
      x = a[p] + rem / (p + 1);
      x = min(x, (long long)A);
      if (!last) x = A;
    }
    long long cur = have * cf + x * cm;
    if (ans < cur) {
      ans = cur;
      blast = last;
      val = x;
    }
  }
  cout << ans << "\n";
  for (int i = 0; i < (int)(blast); ++i) a[i] = max(val, a[i]);
  for (int i = blast; i < n; i++) a[i] = A;
  vector<int> res(n);
  for (int i = 0; i < (int)(n); ++i) res[b[i].second] = a[i];
  for (int i = 0; i < (int)(n); ++i) cout << res[i] << " ";
  cout << "\n";
  return 0;
}
