#include <bits/stdc++.h>
using namespace std;
pair<int, int> vec[100001];
long long acc[100001];
int fin[100005];
int n;
long long m, A, cf, cm;
long long ansCost;
int lastChanged;
long long currAnswer;
long long best;
bool check(long long mi) {
  long long curr = 0;
  int left = 0, right = n - 1, mid, ans = n;
  while (left <= right) {
    mid = (left + right) / 2;
    if (vec[mid].first < mi)
      left = mid + 1;
    else
      ans = mid, right = mid - 1;
  }
  return ans * mi - acc[ans - 1] <= m;
}
int main() {
  scanf("%d %I64d %I64d %I64d %I64d", &n, &A, &cf, &cm, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &fin[i]);
    vec[i] = make_pair(fin[i], i);
  }
  sort(vec, vec + n);
  acc[-1] = 0;
  for (int i = 0; i < n; i++) acc[i] = acc[i - 1] + vec[i].first;
  vec[n] = make_pair(A, -1);
  long long currF = -cf;
  pair<int, int> finAns;
  for (int i = n; i >= 0; i--) {
    m -= A - vec[i].first;
    currF += cf;
    vec[i].first = A;
    if (m < 0) break;
    int left = vec[0].first, right = A, mid, ans;
    while (left <= right) {
      mid = (left + right) / 2;
      if (check(mid)) {
        if (currF + mid * cm >= best) {
          best = currF + mid * cm;
          ans = mid;
          finAns = make_pair(i, mid);
        }
        left = mid + 1;
      } else {
        right = mid - 1;
      }
    }
  }
  for (int i = finAns.first; i < n; i++) fin[vec[i].second] = A;
  for (int i = 0; i < n; i++) fin[i] = max(fin[i], finAns.second);
  printf("%I64d\n", best);
  for (int i = 0; i < n; i++) printf("%d ", fin[i]);
  return 0;
}
