#include <bits/stdc++.h>
using namespace std;
int n, A, cf, cm, u, v, mid, uu, vv, midd, ansa, ansb, ansc;
long long m, now, find, qz[100009], ans;
struct node {
  int val, id;
} q[100009];
bool cmpa(node aa, node bb) { return aa.val < bb.val; }
bool cmpb(node aa, node bb) { return aa.id < bb.id; }
int main() {
  scanf("%d%d%d%d%lld", &n, &A, &cf, &cm, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &q[i].val), q[i].id = i;
  sort(q + 1, q + n + 1, cmpa);
  q[n + 1].val = A;
  for (int i = 1; i <= n; i++) qz[i] = qz[i - 1] + q[i].val;
  now = m;
  for (int i = 0; i <= n; i++) {
    now -= A - q[n - i + 1].val, u = 1, v = A;
    if (now < 0) continue;
    while (u < v) {
      mid = (u + v + 1) / 2;
      uu = 0, vv = n - i;
      while (uu < vv) {
        midd = (uu + vv + 1) / 2;
        if (q[midd].val > mid)
          vv = midd - 1;
        else
          uu = midd;
      }
      if ((long long)(mid)*uu - qz[uu] > now)
        v = mid - 1;
      else
        u = mid;
    }
    if ((long long)(u)*cm + (long long)(i)*cf > ans)
      ans = (long long)(u)*cm + (long long)(i)*cf, ansa = i, ansb = uu,
      ansc = u;
  }
  for (int i = 1; i <= ansb; i++) q[i].val = ansc;
  for (int i = n - ansa + 1; i <= n; i++) q[i].val = A;
  sort(q + 1, q + n + 1, cmpb);
  printf("%lld\n", ans);
  for (int i = 1; i <= n; i++) printf("%d ", q[i].val);
  return 0;
}
