#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
long long a[1000009], aa[1000009], ord[1000009], sol[1000009];
long long n, cf, cm, mx, sum, m, c1[1000009];
bool cmp(long long i, long long j) { return aa[i] < aa[j]; }
int main() {
  while (scanf("%lld%lld%lld%lld%lld", &n, &mx, &cf, &cm, &m) == 5) {
    sum = 0;
    for (int(i) = (0); (i) < (n); ++(i)) {
      scanf("%lld", aa + i);
      sum += aa[i];
      ord[i] = i;
    }
    sort(ord, ord + n, cmp);
    for (int(i) = (0); (i) < (n); ++(i)) a[i] = aa[ord[i]];
    if (sum + m >= mx * n) {
      printf("%lld\n", (cf * n + cm * mx));
      for (int(i) = (0); (i) < (n - 1); ++(i)) printf("%lld ", mx);
      printf("%lld\n", mx);
      continue;
    }
    c1[0] = 0;
    for (int(i) = (1); (i) < (n); ++(i)) {
      int ind = n - i;
      c1[i] = c1[i - 1] + mx - a[ind];
    }
    long long r1 = 1, r2 = a[0], r3 = 0;
    while (r3 < n && a[r3] < mx) r3++;
    long long ans = cf * (n - r3) + cm * r2;
    long long lv = a[0], down = 0;
    long long pos = 1;
    for (long long i = n - 1; i >= 0; i--) {
      long long rem = m - c1[i];
      if (rem >= 0) {
        while (pos < n - i) {
          long long add = pos * (a[pos] - lv);
          if (down + add <= rem) {
            down += add;
            lv = a[pos++];
          } else
            goto out;
        }
      out:
        long long add = (rem - down) / pos;
        add = min(add, mx - lv);
        long long lv2 = lv + add;
        long long opt = cf * i + cm * lv2;
        if (opt > ans) {
          ans = opt;
          r1 = pos;
          r2 = lv2;
          r3 = n - i;
        }
      }
      if (a[n - i] == mx) goto out2;
    }
  out2:
    printf("%lld\n", ans);
    for (int(i) = (0); (i) < (r1); ++(i)) sol[ord[i]] = r2;
    for (int(i) = (r1); (i) < (r3); ++(i)) {
      sol[ord[i]] = a[i];
    }
    for (int(i) = (r3); (i) < (n); ++(i)) sol[ord[i]] = mx;
    for (int(i) = (0); (i) < (n - 1); ++(i)) printf("%lld ", sol[i]);
    printf("%lld\n", sol[n - 1]);
  }
  return 0;
}
