#include <bits/stdc++.h>
using namespace std;
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const pair<Tk, Tv>& p) {
  os << "{" << p.first << ',' << p.second << "}";
  return os;
}
const int MAX = 100005;
const int MOD = 1000000007;
const int INF = 1000000005;
int n;
long long a[MAX], b[MAX];
long long pref[MAX];
long long A, cf, cm, m;
int main() {
  scanf("%d", &n);
  scanf("%lld%lld%lld%lld", &A, &cf, &cm, &m);
  vector<pair<int, int> > p;
  for (int i = 0; i < n; i++) {
    long long temp;
    scanf("%lld", &temp);
    p.push_back(make_pair(temp, i));
  }
  for (int i = 0; i < n; i++) b[i] = p[i].first;
  sort(p.begin(), p.end());
  for (int i = 0; i < n; i++) a[i] = p[i].first;
  long long required = 0;
  for (int i = 0; i < n; i++) required += A - a[i];
  if (required <= m) {
    long long p = cf * n + cm * A;
    printf("%lld\n", p);
    for (int i = 0; i < n; i++) {
      printf("%d ", A);
    }
    printf("\n");
  } else {
    pref[0] = a[0];
    for (int i = 1; i < n; i++) {
      pref[i] = pref[i - 1] + a[i];
    }
    int uptoHere = n;
    long long mn = 0;
    int j = 0;
    for (int i = 0; i < n; i++) {
      long long cost = (i + 1) * a[i] - pref[i];
      if (cost > m)
        break;
      else {
        long long spare = m - cost;
        mn = min(A, a[i] + spare / (i + 1));
        j = i;
      }
    }
    long long mxsum = mn * cm;
    long long sum = 0;
    for (int i = n - 1; i > 0; i--) {
      sum += A - a[i];
      long long left = m - sum;
      if (left < 0) break;
      long long cost = (j + 1) * a[j] - pref[j];
      while ((j >= i) || (j > 0 && cost > left)) {
        j--;
        cost = (j + 1) * a[j] - pref[j];
      }
      long long spare = left - cost;
      long long tmin = min(A, a[j] + spare / (j + 1));
      if (mxsum < cf * (n - i) + cm * tmin) {
        mxsum = cf * (n - i) + cm * tmin;
        uptoHere = i;
        mn = tmin;
      }
    }
    printf("%lld\n", mxsum);
    sum = 0;
    for (int i = n - 1; i >= uptoHere; i--) {
      sum -= A - a[i];
      b[p[i].second] = a[i] = A;
    }
    long long left = m - sum;
    for (int i = 0; i < n; i++) {
      if (a[i] <= mn) {
        if (mn - a[i] <= left) {
          left -= (mn - a[i]);
          b[p[i].second] = a[i] = mn;
        } else {
          break;
        }
      } else {
        break;
      }
    }
    for (int i = 0; i < n; i++) {
      printf("%lld ", b[i]);
    }
    printf("\n");
  }
}
