#include <bits/stdc++.h>
const double pi = (double)(2.0 * acos(0.0));
const int inf = 1 << 30;
const double eps = 1E-9;
const double e = exp(1.0);
const int sz = 100000 + 5;
const int mod = 1000000000 + 7;
using namespace std;
pair<long long int, long long int> a[sz];
long long int n, m, A, cf, cm, tt[sz];
bool cmp(pair<long long int, long long int> p,
         pair<long long int, long long int> q) {
  return (p.second < q.second);
}
long long int mn(long long int rm, long long int na) {
  long long int l, h, md, l1, h1, md1, tmp;
  l = a[0].first, h = A;
  while (l <= h) {
    md = (l + h) / 2;
    l1 = 0, h1 = n - 1 - na;
    while (l1 <= h1) {
      md1 = (l1 + h1) / 2;
      if (a[md1].first < md)
        l1 = md1 + 1;
      else
        h1 = md1 - 1;
    }
    tmp = (1 + h1) * md - tt[1 + h1];
    if (tmp > rm)
      h = md - 1;
    else
      l = md + 1;
  }
  return h;
}
int main() {
  bool ch;
  long long int i, na, nd_na, fna, mn_a, fg, res, ar, fmn_a;
  scanf("%I64d %I64d %I64d %I64d %I64d", &n, &A, &cf, &cm, &m);
  for (i = 0; i < n; i++) scanf("%I64d", &ar), a[i] = make_pair(ar, i);
  sort(a, a + n);
  tt[0] = 0;
  for (i = 0; i < n; i++) tt[i + 1] = tt[i] + a[i].first;
  res = 0;
  fna = 0;
  fmn_a = 0;
  for (i = n; i >= 0; i--) {
    if (i == n)
      nd_na = 0, na = 0;
    else
      nd_na += A - a[i].first, na++;
    ;
    if (nd_na <= m) {
      mn_a = mn(m - nd_na, na);
      fg = ((mn_a == A) ? n : na) * cf + mn_a * cm;
      if (res < fg) res = fg, fna = na, fmn_a = mn_a;
    } else
      break;
  }
  for (i = 1; i <= fna; i++) a[n - i].first = A;
  for (i = 0; i < n; i++)
    a[i].first = ((a[i].first < fmn_a) ? fmn_a : a[i].first);
  printf("%I64d\n", res);
  sort(a, a + n, cmp);
  for (i = 0; i < n; i++) {
    i&& printf(" ");
    printf("%I64d", a[i].first);
  }
  puts("");
  return 0;
}
