#include <bits/stdc++.h>
using namespace std;
long long n, A, cf, cm, m;
struct node {
  long long x;
  int i;
} a[100001];
long long sum[100001];
long long ans = 0;
bool cmp(node a, node b) { return a.x < b.x; }
bool cmp1(node a, node b) { return a.i < b.i; }
long long minc = 0;
long long bsearch(long long x) {
  int l = 0;
  int r = n;
  while (l < r) {
    int mid = l + (r - l) / 2;
    if (a[mid].x > x)
      r = mid;
    else
      l = mid + 1;
  }
  return l;
}
void solve() {
  for (int i = 0; i < n; ++i) {
    long long num = m - (A * (long long)i - (sum[n - 1] - sum[n - 1 - i]));
    if (num < 0) break;
    long long l = a[0].x - 1;
    long long r = A;
    while (l < r) {
      long long mid = l + (r - l) / 2;
      long long k = bsearch(mid) - 1;
      if (k + i >= n) k = n - 1 - i;
      long long sum1 = (mid * (k + 1) - sum[k]);
      if (sum1 > num)
        r = mid;
      else
        l = mid + 1;
    }
    l--;
    if (ans <= (long long)i * cf + (long long)l * cm) {
      ans = (long long)i * cf + (long long)l * cm;
      minc = l;
    }
  }
}
int main() {
  while (cin >> n >> A >> cf >> cm >> m) {
    for (int i = 0; i < n; ++i) {
      scanf("%lld", &a[i].x);
      a[i].i = i;
    }
    a[n].x = A + 1;
    a[n].i = n;
    ans = 0;
    sort(a, a + n, cmp);
    sum[0] = a[0].x;
    for (int i = 1; i < n; ++i) sum[i] = sum[i - 1] + a[i].x;
    if (A * n <= sum[n - 1] + m) {
      ans = n * cf + A * cm;
      minc = A;
    } else {
      solve();
    }
    for (int i = 0; i < n; ++i) {
      if (a[i].x < minc) {
        m -= minc - a[i].x;
        a[i].x = minc;
      } else
        break;
    }
    for (int i = n - 1; i >= 0; --i) {
      if (A - a[i].x <= m) {
        m -= A - a[i].x;
        a[i].x = A;
      } else {
        a[i].x += m;
        m = 0;
        break;
      }
    }
    sort(a, a + n, cmp1);
    printf("%lld\n", ans);
    for (int i = 0; i < n; ++i) {
      if (i == n - 1)
        printf("%lld\n", a[i].x);
      else
        printf("%lld ", a[i].x);
    }
  }
  return 0;
}
