#include <bits/stdc++.h>
using namespace std;
int n;
long long A, cf, cm, m, af, am, v;
long long a[131072], b[131072], s[131072];
int id[131072];
int rk[131072];
bool cmp(int x, int y) { return a[x] > a[y]; }
long long check(int nf, long long lm) {
  long long ans = A * nf - (s[n] - s[n - nf]);
  int p = lower_bound(b + 1, b + 2 + n, lm + 1) - b;
  p--;
  if (p + nf > n) p = n - nf;
  ans += lm * p - s[p];
  return ans;
}
int main() {
  scanf("%d%I64d%I64d%I64d%I64d", &n, &A, &cf, &cm, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%I64d", a + i);
    b[i] = a[i];
    id[i] = i;
  }
  sort(id + 1, id + 1 + n, cmp);
  sort(b + 1, b + 1 + n);
  b[n + 1] = A + 1;
  for (int i = 1; i <= n; ++i) s[i] = s[i - 1] + b[i];
  v = -1;
  for (int i = 0; i <= n; ++i) {
    long long l = 0, r = A, mid, tm = -1, ta;
    while (l <= r) {
      mid = (l + r) / 2;
      if (check(i, mid) <= m) {
        tm = mid;
        l = mid + 1;
      } else
        r = mid - 1;
    }
    if (tm != -1) {
      ta = tm * cm + cf * i;
      if (ta > v) {
        v = ta;
        am = tm;
        af = i;
      }
    }
  }
  printf("%I64d\n", v);
  for (int i = 1; i <= af; ++i) b[id[i]] = A;
  for (int i = af + 1; i <= n; ++i) b[id[i]] = max(a[id[i]], am);
  for (int i = 1; i <= n; ++i) {
    printf("%d", (int)b[i]);
    if (i < n)
      printf(" ");
    else
      printf("\n");
  }
  return 0;
}
