#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
long long n, A, cf, cm, m, a[N], ss[N];
pair<long long, long long> p[N];
long long ps[N];
long long can(int cur, int have) {
  long long need = 0;
  int l = 1, r = have;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (p[mid - 1].first < cur)
      l = mid + 1;
    else
      r = mid - 1;
  }
  l -= 1;
  need = (long long)cur * (long long)(l)-ps[l];
  return need;
}
int main() {
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 0; i < n; i++) cin >> a[i], p[i] = make_pair(a[i], i);
  sort(p, p + n);
  for (int i = 1; i <= n; i++) ps[i] = ps[i - 1] + p[i - 1].first;
  int fmx, fmn;
  long long ans = -1;
  for (int i = 0; i <= n; i++) {
    long long nmx = i * 1ll * A - ps[n] + ps[n - i];
    if (nmx > m) break;
    int l = 0, r = A;
    long long have = m - nmx;
    while (l <= r) {
      int mid = (l + r) >> 1;
      long long k = can(mid, n - i);
      if (nmx + k <= m)
        l = mid + 1;
      else
        r = mid - 1;
    }
    l -= 1;
    long long tans = (long long)l * cm + (long long)i * cf;
    if (tans > ans) ans = tans, fmx = i, fmn = l;
  }
  cout << ans << endl;
  for (int i = n - 1; i >= n - fmx; i--) a[p[i].second] = A;
  for (int i = 0; i < n - fmx; i++)
    a[p[i].second] = max(a[p[i].second], (long long)fmn);
  for (int i = 0; i < n; i++) cout << a[i] << ' ';
  return 0;
}
