#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  long long A, cf, cm, M;
  scanf("%d%I64d%I64d%I64d%I64d", &N, &A, &cf, &cm, &M);
  vector<long long> a(N), xm(N + 1), xf(N + 1);
  vector<pair<int, int>> vec(N);
  for (int i = 0; i < (int)(N); i++) scanf("%I64d", &a[i]);
  for (int i = 0; i < (int)(N); i++) vec[i] = make_pair(a[i], i);
  sort((vec).begin(), (vec).end());
  sort(a.rbegin(), a.rend());
  for (int i = 0; i < (int)(N); i++) xm[i + 1] = xm[i] + A - a[i];
  sort(a.begin(), a.end());
  for (int i = 0; i < (int)(N); i++) xf[i + 1] = xf[i] + a[i];
  for (int i = 0; i < (int)(N + 1); i++)
    xf[i] = (i == 0 ? 0LL : a[i - 1]) * i - xf[i];
  long long res = 0, resi = 0, resj = 0, val = 0;
  int j = 0;
  for (int i = 0; i < (int)(N + 1); i++) {
    long long rest = M - xm[N - i];
    if (rest < 0) continue;
    while (j < i && xf[j + 1] <= rest) ++j;
    if (i == 0) {
      res = A * cm + cf * N;
      resi = N;
      resj = N;
      break;
    }
    long long nval = min(A, a[j - 1] + (rest - xf[j]) / j);
    long long score = nval * cm + (N - i) * cf;
    if (res < score) {
      res = score;
      resi = (N - i);
      resj = j, val = nval;
    }
  }
  for (int i = 0; i < (int)(resj); i++) vec[i].first = val;
  reverse((vec).begin(), (vec).end());
  for (int i = 0; i < (int)(resi); i++) vec[i].first = A;
  for (int i = 0; i < (int)(N); i++) swap(vec[i].first, vec[i].second);
  sort((vec).begin(), (vec).end());
  cout << res << endl;
  for (int i = 0; i < (int)(N); i++) {
    printf("%d", vec[i].second);
    if (i == N - 1)
      printf("\n");
    else
      printf(" ");
  }
  return 0;
}
