#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long a, cf, cm, m;
  cin >> n >> a >> cf >> cm >> m;
  pair<long long, long long> A[((int)1e5)] = {};
  long long B[((int)1e5) + 1] = {}, C[((int)1e5)] = {}, D[((int)1e5)] = {};
  for (int x = 0; x < n; x++) cin >> A[x].first, A[x].second = x;
  sort(A, A + n);
  for (int x = n - 1; x >= 0; x--) B[x] = (a - A[x].first) + B[x + 1];
  C[0] = A[0].first;
  for (int x = 1; x < n; x++) C[x] = A[x].first + C[x - 1];
  for (int x = 1; x < n; x++) D[x] = ((long long)x) * A[x].first - C[x - 1];
  int i = n, j = 0, l = 0, l2 = 0;
  long long best = 0;
  for (int x = n; x >= 0; x--) {
    long long tmpStart = B[x];
    if (tmpStart > m) break;
    long long left = m - tmpStart;
    auto it = upper_bound(D, D + x, left);
    int equals = it - D;
    equals = equals - 1;
    left -= equals >= 0 ? D[equals] : 0;
    long long tmp23 =
        cm * (x == 0 ? a
                     : min(a, A[max(equals, 0)].first +
                                  (equals >= 0 ? (left / (equals + 1)) : 0))) +
        cf * ((long long)(n - x));
    if (tmp23 > best) {
      i = x;
      best = tmp23;
      j = equals;
      l2 = left;
      l = (equals >= 0 ? (left / (equals + 1)) : 0);
    }
  }
  for (int x = n - 1; x >= i; x--) A[x].first = a;
  for (int x = 0; x < j; x++) A[x].first = A[j].first;
  for (int x = 0; x <= j; x++) A[x].first += l;
  for (int x = 0; x < n; x++) swap(A[x].first, A[x].second);
  cout << best << endl;
  sort(A, A + n);
  for (int x = 0; x < n; x++) cout << A[x].second << " \n"[x + 1 == n];
}
