#include <bits/stdc++.h>
using namespace std;
int N;
long long MaxA, Cf, Cm;
long long M;
long long A[100010] = {0};
long long Sum[100010] = {0};
long long Ans = 0;
long long Need = 0;
int Cnt = 0;
int id[100010] = {0};
bool cmp(int a1, int a2) { return A[a1] < A[a2]; }
int main() {
  cin >> N >> MaxA >> Cf >> Cm >> M;
  for (int i = 1; i <= N; i++) scanf("%I64d", &A[i]), id[i] = i;
  Cnt = N + 1;
  sort(id + 1, id + N + 1, cmp);
  for (int i = 2; i <= N; i++)
    Sum[i] = Sum[i - 1] + (A[id[i]] - A[id[i - 1]]) * (i - 1);
  A[N + 1] = MaxA;
  id[N + 1] = N + 1;
  for (int i = N + 1; i >= 2; i--) {
    Need += MaxA - A[id[i]];
    long long remains = M - Need;
    if (remains < 0) continue;
    int l = 1, r = i - 1;
    int S = 1;
    for (; l <= r;) {
      int mid = (l + r) >> 1;
      if (Sum[mid] <= remains) {
        S = mid;
        l = mid + 1;
      } else
        r = mid - 1;
    }
    remains -= Sum[S];
    long long Add = min(remains / S, MaxA - A[id[S]]);
    if ((N - i + 1) * Cf + (A[id[S]] + Add) * Cm > Ans) {
      Ans = (N - i + 1) * Cf + (A[id[S]] + Add) * Cm;
      Cnt = i;
    }
  }
  Need += MaxA - A[id[1]];
  if (Need <= M) {
    cout << N * Cf + MaxA * Cm << endl;
    for (int i = 1; i <= N; i++) printf("%I64d ", MaxA);
    return 0;
  }
  for (int i = N; i >= Cnt; i--) {
    M -= MaxA - A[id[i]];
    A[id[i]] = MaxA;
  }
  int l = 1, r = Cnt - 1;
  int S = 1;
  for (; l <= r;) {
    int mid = (l + r) >> 1;
    if (Sum[mid] <= M) {
      S = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  M -= Sum[S];
  long long Add = min(M / S, MaxA - A[id[S]]);
  M -= Add * S;
  for (int i = 1; i <= S; i++) A[id[i]] = A[id[S]] + Add;
  cout << Ans << endl;
  for (int i = 1; i <= N; i++) printf("%I64d ", A[i]);
  return 0;
}
