#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int N = 1e5 + 10;
int n, ans[N], a[N], p[N], per[N];
long long full, cf, cl, m, L[N], R[N];
template <class T>
bool maximize(T &x, T y) {
  if (x < y)
    x = y;
  else
    return 0;
  return 1;
}
bool comp(int x, int y) { return a[x] < a[y]; }
void prepare() {
  scanf("%d%lld%lld%lld%lld", &n, &full, &cf, &cl, &m);
  for (auto i = (1); i <= (n); i++) scanf("%d", a + i);
  for (auto i = (1); i <= (n); i++) per[i] = i;
  sort(per + 1, per + n + 1, comp);
  for (auto i = (1); i <= (n); i++) p[i] = a[per[i]];
  for (auto i = (1); i <= (n); i++) L[i] = L[i - 1] + p[i];
  for (auto i = (n); i >= (1); i--) R[i] = R[i + 1] + p[i];
}
long long cal(int sel, int type) {
  long long rem = m - (full * (n - sel + 1) - R[sel]);
  if (rem < 0) return -1;
  int cL = 0, cR = full;
  while (cL <= cR) {
    int mid = (cL + cR) / 2;
    int idx = lower_bound(p + 1, p + sel, mid) - p - 1;
    if (1LL * idx * mid - L[idx] <= rem)
      cL = mid + 1;
    else
      cR = mid - 1;
  }
  if (type == 1) {
    for (auto i = (n); i >= (sel); i--) ans[per[i]] = full;
    for (auto i = (1); i < (sel); i++) ans[per[i]] = max(p[i], cR);
  }
  return cf * (n - sel + 1) + cl * cR;
}
void solve() {
  long long answ = -1, sel = -1;
  for (auto i = (1); i <= (n + 1); i++)
    if (maximize(answ, cal(i, 0))) sel = i;
  cal(sel, 1);
  printf("%lld\n", answ);
  for (auto i = (1); i <= (n); i++) printf("%d ", ans[i]);
}
int main() {
  prepare();
  solve();
}
