#include <bits/stdc++.h>
using namespace std;
void run() {
  long long n, A, cf, cm, m;
  scanf("%lld %lld %lld %lld %lld", &n, &A, &cf, &cm, &m);
  vector<pair<long long, long long> > al(n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &al[i].first);
    al[i].first *= -1;
    al[i].second = i;
  }
  sort(al.begin(), al.end());
  for (int i = 0; i < n; i++) al[i].first *= -1;
  vector<long long> fa(n);
  fa[n - 1] = 0;
  for (int i = n - 2; i >= 0; i--) {
    fa[i] = fa[i + 1] + (al[i].first - al[i + 1].first) * (n - 1 - i);
  }
  long long sum = 0;
  long long j = 0;
  long long maxi = -1;
  long long mini = -1;
  long long maxv = -1;
  for (int i = -1; i < n; i++) {
    while (j <= i) j++;
    if (i >= 0) sum += A - al[i].first;
    if (sum > m) break;
    long long cmin;
    long long rest = 0;
    if (i == n - 1) {
      cmin = A;
    } else {
      rest = m - sum;
      while (fa[j] > rest) j++;
      rest -= fa[j];
      if (j != n) cmin = al[j].first + (rest / (n - j));
    }
    long long total;
    if (cmin >= A)
      total = n * cf + A * cm;
    else
      total = (i + 1) * cf + cmin * cm;
    cmin = min((long long)A, cmin);
    if (total >= maxv) {
      maxv = total;
      mini = cmin;
      maxi = (i + 1);
    }
  }
  vector<long long> r(n);
  for (int i = 0; i < n; i++) {
    if (i < maxi)
      r[al[i].second] = A;
    else
      r[al[i].second] = max(mini, al[i].first);
  }
  printf("%lld\n", maxv);
  for (int i = 0; i < n; i++) {
    if (i > 0) printf(" ");
    printf("%lld", r[i]);
  }
  printf("\n");
}
int main() {
  cout << fixed << setprecision(16);
  run();
  return 0;
}
