#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
const int N = 101000;
int n, val[N];
pair<int, int> p[N];
long long A, cf, cm, m, s[N];
int main() {
  scanf("%d%lld%lld%lld%lld", &n, &A, &cf, &cm, &m);
  for (int i = 1; i < n + 1; i++) {
    scanf("%d", &p[i].first);
    p[i].second = i;
  }
  sort(p + 1, p + n + 1);
  p[n + 1].first = A;
  for (int i = 1; i < n + 1; i++) s[i] = s[i - 1] + p[i].first;
  long long ans = 0;
  int ansp = 0, ansl = 0, ansv = 0;
  if (n * A - s[n] <= m) {
    ans = A * cm + n * cf;
    ansp = 0;
    ansl = 0;
    ansv = 0;
  }
  for (int i = 1; i < n + 1; i++) {
    long long c = (n - i) * A - (s[n] - s[i]);
    if (c > m) continue;
    long long rm = m - c;
    int l = 1, r = i + 1;
    while (l + 1 < r) {
      int md = (l + r) >> 1;
      long long sm = (long long)p[md].first * md - s[md];
      if (sm <= rm)
        l = md;
      else
        r = md;
    }
    rm -= ((long long)p[l].first * l - s[l]);
    long long nv = p[l + 1].first;
    if (l == i) nv = A;
    long long mm = min(p[l].first + rm / l, nv);
    long long ret = mm * cm + (n - i) * cf;
    if (ret >= ans) {
      ans = ret;
      ansp = i;
      ansl = l;
      ansv = mm;
    }
  }
  printf("%lld\n", ans);
  for (int i = ansp + 1; i < n + 1; i++) p[i].first = A;
  for (int i = 1; i < ansl + 1; i++) p[i].first = ansv;
  for (int i = 1; i < n + 1; i++) val[p[i].second] = p[i].first;
  for (int i = 1; i < n + 1; i++) printf("%d ", val[i]);
  puts("");
}
