#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int N = 100001;
pair<long long, int> P[N];
long long B[N];
long long C[N];
int n, cf, cm;
long long A, m;
int main() {
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 0; i < (n); i++) {
    cin >> P[i].first;
    P[i].second = i;
  }
  sort(P, P + n);
  for (int i = (1); i <= (n - 1); i++)
    B[i] = B[i - 1] + (P[i].first - P[i - 1].first) * i;
  for (int i = n - 1; i >= 0; --i) C[i] = C[i + 1] + A - P[i].first;
  long long bestVal = 0;
  int numA = 0;
  long long valMin = 0;
  int numMin = 0;
  long long mx = 0;
  for (int i = 0; i < (n); i++) {
    long long mm = m - C[i + 1];
    if (mm >= 0) {
      int ans = 0;
      int low = 1;
      int high = i + 1;
      while (low < high) {
        int mid = ((low + high) >> 1);
        if (B[mid] > mm)
          high = mid;
        else {
          ans = mid;
          low = mid + 1;
        }
      }
      mm -= B[ans];
      long long vm = P[ans].first + mm / (ans + 1);
      long long val = vm * cm + (long long)cf * (n - 1 - i);
      if (val >= bestVal) {
        bestVal = val;
        valMin = vm;
        numA = (n - 1 - i);
        numMin = ans + 1;
      }
    }
  }
  if (C[0] <= m) {
    bestVal = (long long)cf * n + A * cm;
    numA = n;
    valMin = A;
    numMin = 0;
  }
  for (int i = 0; i < (numMin); i++) P[i].first = valMin;
  for (int i = (n - numA); i <= (n - 1); i++) P[i].first = A;
  int RET[N];
  for (int i = 0; i < (n); i++) RET[P[i].second] = P[i].first;
  cout << bestVal << endl;
  for (int i = 0; i < (n); i++) cout << RET[i] << " ";
  cout << endl;
  return 0;
}
