#include <bits/stdc++.h>
using namespace std;
int n, A, cf, cm;
long long m, sum[100010];
struct node {
  int a, i;
} p[100010];
bool CMP1(node a, node b) { return a.a < b.a; }
bool CMP2(node a, node b) { return a.i < b.i; }
int main() {
  int i, j = -1, k = -1, l, r, mid;
  long long ans = 0, t, s, res;
  scanf("%d%d%d%d%I64d", &n, &A, &cf, &cm, &m);
  for (i = 1; i <= n; ++i) {
    scanf("%d", &p[i].a);
    p[i].i = i;
  }
  sort(p + 1, p + 1 + n, CMP1);
  for (i = 1; i <= n; ++i) sum[i] = sum[i - 1] + p[i].a;
  for (i = 0; i <= n; ++i) {
    if (1LL * A * i - (sum[n] - sum[n - i]) > m) break;
    t = m - (1LL * A * i - (sum[n] - sum[n - i]));
    for (l = 1, r = n - i; l < r; mid = (l + r + 1) >> 1,
        1LL * p[mid].a * mid - sum[mid] > t ? r = mid - 1 : l = mid)
      ;
    t -= 1LL * p[r].a * r - sum[r];
    s = p[r].a;
    if (r)
      s += t / r;
    else
      s = A;
    if (s > A) s = A;
    if ((res = 1LL * s * cm + 1LL * i * cf) > ans) ans = res, k = i, j = r;
  }
  printf("%I64d\n", ans);
  for (i = 0; i < k; ++i) m -= A - p[n - i].a, p[n - i].a = A;
  if (j) {
    for (i = 1; i < j; ++i) m -= p[j].a - p[i].a, p[i].a = p[j].a;
    t = m / j;
    for (i = 1; i <= j; ++i) m -= t, p[i].a += t;
    for (i = 1; i <= j && m; ++i) --m, ++p[i].a;
  }
  sort(p + 1, p + 1 + n, CMP2);
  for (i = 1; i <= n; ++i) printf("%d ", p[i].a);
  return 0;
}
