#include <bits/stdc++.h>
using namespace std;
long long mini(vector<long long>& cum, long long a, int n,
               vector<long long>& arr) {
  if (n == 0) return (long long)1e16;
  int pos = upper_bound(cum.begin(), cum.end(), a) - cum.begin();
  pos--;
  pos = min(pos, n - 1);
  long long rm_a = a - cum[pos];
  return arr[pos] + rm_a / (pos + 1);
}
int main() {
  long long n, a, cf, cm, m;
  cin >> n >> a >> cf >> cm >> m;
  vector<long long> arr(n), cum(n, 0), diff(n, 0), cum_diff(n, 0);
  vector<pair<long long, long long> > ap(n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    arr[i] = x;
    ap[i].second = i;
    ap[i].first = arr[i];
  }
  sort(arr.begin(), arr.end());
  sort(ap.begin(), ap.end());
  long long last = 0, diff_last = 0;
  for (int i = 0; i < n; i++) diff[n - i - 1] = a - arr[i];
  for (int i = 0; i < n; i++) {
    diff_last = cum_diff[i] = diff_last + diff[i];
  }
  for (int i = 1; i < n; i++) {
    cum[i] = cum[i - 1] + (arr[i] - arr[i - 1]) * i;
  }
  long long ans = 0;
  int mi = 0, full = 0;
  for (int i = 0; i <= n; i++) {
    long long rm_a = m - ((i == 0) ? 0 : cum_diff[i - 1]);
    if (rm_a < 0) break;
    long long tans = cf * i;
    long long minimum = min(a, mini(cum, rm_a, n - i, arr));
    tans += minimum * cm;
    if (tans > ans) {
      mi = minimum;
      ans = tans;
      full = i;
    }
  }
  for (int i = 0; i < n; i++) {
    if (ap[i].first < mi) ap[i].first = mi;
    if (i >= n - full) ap[i].first = a;
    swap(ap[i].first, ap[i].second);
  }
  sort(ap.begin(), ap.end());
  cout << ans << "\n";
  for (int i = 0; i < n; i++) {
    cout << ap[i].second << " ";
  }
  return 0;
}
