#include <bits/stdc++.h>
using namespace std;
struct Array {
  int index;
  long long x;
} a[200111];
bool cmp(Array a, Array b) { return a.x > b.x; }
long long b[200111], sum[200111];
long long n, A, Cf, Cm, m;
int main() {
  cin >> n >> A >> Cf >> Cm >> m;
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &a[i].x);
    a[i].index = i;
  }
  sort(a, a + n, cmp);
  for (int i = n - 1; i >= 0; i--)
    sum[i] = sum[i + 1] + (a[i].x - a[i + 1].x) * (n - i - 1);
  int j = 0;
  long long ans = -1;
  long long globalMin, cnt;
  for (int i = 0; i <= n; i++) {
    if (i > 0) {
      if (A - a[i - 1].x > m) break;
      m -= (A - a[i - 1].x);
    }
    while (j <= i - 1 || m < sum[j]) j++;
    long long localMin;
    if (j == n)
      localMin = A;
    else
      localMin = min(A, a[j].x + (m - sum[j]) / (n - j));
    long long localAns = Cf * i + Cm * localMin;
    if (localAns > ans) {
      cnt = i;
      ans = localAns;
      globalMin = localMin;
    }
  }
  for (int i = 0; i < n; i++)
    if (i < cnt)
      b[a[i].index] = A;
    else if (a[i].x > globalMin)
      b[a[i].index] = a[i].x;
    else
      b[a[i].index] = globalMin;
  printf("%I64d\n", ans);
  for (int i = 0; i < n; i++) printf("%I64d ", b[i]);
  printf("\n");
}
