#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
int n, A, cf, cm;
pair<int, int> a[N];
long long units, prefix[N], suffix[N];
bool comp(pair<int, int> a, pair<int, int> b) { return a.first > b.first; }
int main() {
  cin >> n >> A >> cf >> cm >> units;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a, a + n, comp);
  prefix[0] = suffix[0] = 0;
  for (int i = 0; i < n; i++) prefix[i + 1] = prefix[i] + a[i].first;
  for (int i = 1; i < n; i++)
    suffix[i] = (a[n - i - 1].first - a[n - i].first) * i + suffix[i - 1];
  int imax = 0;
  long long raised_min = 0, val = -1, bestVal = -1, bestMin = a[n - 1].first;
  for (long long i = 0; i <= n; i++) {
    long long req = A * i - prefix[i];
    long long left = units - req;
    if (left < 0) break;
    if (i < n) {
      int pos = upper_bound(suffix, suffix + n - i, left) - suffix;
      pos--;
      left -= suffix[pos];
      long long up_raise = left / (pos + 1);
      raised_min = a[n - pos - 1].first + up_raise;
      if (raised_min > A) raised_min = A;
    } else
      raised_min = A;
    val = i * cf + raised_min * cm;
    if (val > bestVal) {
      imax = i;
      bestMin = raised_min;
      bestVal = val;
    }
  }
  vector<int> updated(n);
  for (int i = 0; i < imax; i++) updated[a[i].second] = A;
  for (int i = imax; i < n; i++) {
    if (a[i].first < bestMin)
      updated[a[i].second] = bestMin;
    else
      updated[a[i].second] = a[i].first;
  }
  cout << bestVal << endl;
  for (auto x : updated) cout << x << " ";
  return 0;
}
