#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
const int max_n = 1e5 + 5;
int n, A;
long long int pref[max_n];
long long int suf[max_n];
bool moge(int war, long long int zost, int brzeg) {
  int left = 0, right = brzeg;
  while (right - left > 1) {
    int mid = (right + left) / 2;
    if (v[mid].first > war)
      right = mid;
    else
      left = mid;
  }
  int ans = left;
  if (v[right].first <= war) ans = right;
  if ((ans + 1) * 1LL * war - pref[ans] <= zost)
    return true;
  else
    return false;
}
int answ[max_n];
int main() {
  scanf("%d%d", &(n), &(A));
  ;
  int(c1), (c2);
  scanf("%d%d", &(c1), &(c2));
  ;
  long long int m;
  scanf("%I64d", &m);
  for (int i = (0); i < (n); ++i) {
    int(a);
    scanf("%d", &(a));
    ;
    v.push_back(make_pair(a, i));
  }
  sort((v).begin(), (v).end());
  pref[0] = v[0].first;
  for (int i = (1); i < (n); ++i) pref[i] = pref[i - 1] + v[i].first;
  suf[n - 1] = v[n - 1].first;
  for (int i = (n - 2); i >= (0); --i) suf[i] = suf[i + 1] + v[i].first;
  long long int best = 0;
  int dla1 = -1;
  int dla2 = -2;
  for (int i = (0); i < (n + 1); ++i) {
    long long int wyd = i * 1LL * A - (i == 0 ? 0 : suf[n - i]);
    if (wyd > m) break;
    int brzeg = n - i - 1;
    long long int zost = m - wyd;
    int left = 0, right = A;
    while (right - left > 1) {
      int mid = (right + left) / 2;
      if (moge(mid, zost, brzeg))
        left = mid;
      else
        right = mid;
    }
    int ans = left;
    if (moge(right, zost, brzeg)) ans = right;
    long long int loc = c1 * 1LL * i + c2 * 1LL * ans;
    if (loc > best) {
      best = loc;
      dla1 = i;
      dla2 = ans;
    }
  }
  if (n * 1LL * A - pref[n - 1] <= m) {
    best = (c1 * 1LL * n + c2 * 1LL * A);
    dla1 = 0;
    dla2 = A;
  }
  printf("%I64d\n", best);
  for (int j = (0); j < (dla1); ++j) v[n - 1 - j].first = A;
  for (int j = (0); j < (n); ++j)
    if (v[j].first < dla2) v[j].first = dla2;
  for (int j = (0); j < (n); ++j) answ[v[j].second] = v[j].first;
  for (int j = (0); j < (n); ++j) printf("%d ", answ[j]);
  printf("\n");
}
