#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
long long n, a, cf, cm, m;
long long pre[N], ans[N];
pair<long long, int> arr[N];
inline bool solve(int st, int x, long long cash) {
  int l = st, r = n, idx = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (arr[mid].first < x) {
      idx = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  if (!idx) return true;
  long long terms = (n - idx + 1);
  long long need = (terms * 1LL * x) - (pre[n] - pre[idx - 1]);
  return (cash >= need);
}
int main() {
  ios ::sync_with_stdio(false);
  cin >> n >> a >> cf >> cm >> m;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i].first;
    arr[i].second = i;
  }
  sort(arr + 1, arr + 1 + n);
  reverse(arr + 1, arr + 1 + n);
  for (int i = 1; i <= n; i++) {
    pre[i] = pre[i - 1] + arr[i].first;
  }
  long long res = 0, prefix = 0, minimum = 0;
  for (int i = 0; i <= n; i++) {
    long long max_out_cost = (i * 1LL * a) - pre[i];
    if (max_out_cost > m) continue;
    long long rem = m - max_out_cost;
    int l = 1, r = a, mn = 1;
    while (l <= r) {
      int mid = (l + r) >> 1;
      if (solve(i + 1, mid, rem)) {
        mn = mid;
        l = mid + 1;
      } else {
        r = mid - 1;
      }
    }
    if (cf * i + cm * mn > res) {
      res = cf * i + cm * mn;
      prefix = i;
      minimum = mn;
    }
  }
  cout << res << '\n';
  for (int i = 1; i <= n; i++) {
    ans[arr[i].second] = (i <= prefix) ? (a) : (arr[i].first);
    ans[arr[i].second] = max(ans[arr[i].second], minimum);
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i];
    if (i < n) cout << ' ';
  }
  cout << '\n';
}
