#include <bits/stdc++.h>
using namespace std;
long long n, m, cf, cm, A;
long long a[100005], b[100005], sm1[100005], sm2[100005], as[100005];
bool check(long long x, long long sum, int p) {
  long long l = 1, r = n, t = n, num = 0;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (a[mid] > x)
      t = mid - 1, r = mid - 1;
    else
      l = mid + 1;
  }
  if (t >= p) t = p - 1;
  num = num + sm2[t];
  num = num + (x - a[t]) * t;
  if (sum - num >= 0) return 1;
  return 0;
}
int main(void) {
  long long ans = 0, xx = 0, yy = 0;
  scanf("%lld%lld%lld%lld%lld", &n, &A, &cf, &cm, &m);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]), b[i] = a[i];
  sort(a + 1, a + n + 1);
  for (int i = n; i > 0; i--) sm1[i] = sm1[i + 1] + A - a[i];
  for (int i = 2; i <= n; i++)
    sm2[i] = sm2[i - 1] + (a[i] - a[i - 1]) * (i - 1);
  for (int i = 0; i <= n; i++) {
    long long p = a[n - i + 1];
    long long ret = m - sm1[n - i + 1];
    if (ret < 0) break;
    long long l = 0, r = A, tmp = 0;
    while (l <= r) {
      long long mid = (l + r) / 2;
      if (check(mid, ret, n - i + 1)) {
        tmp = mid;
        l = mid + 1;
      } else
        r = mid - 1;
    }
    if (cf * i + cm * tmp > ans) {
      ans = cf * i + cm * tmp;
      xx = tmp;
      yy = p;
    }
  }
  for (int i = 1; i <= n; i++) as[i] = b[i];
  for (int j = 1; j <= n; j++) {
    if (b[j] <= xx) as[j] = xx;
    if (yy != 0 && b[j] >= yy) as[j] = A;
  }
  printf("%lld\n", ans);
  for (int i = 1; i <= n; i++) printf("%lld ", as[i]);
  printf("\n");
  return 0;
}
