#include <bits/stdc++.h>
using namespace std;
typedef struct lol {
  long long x;
  int poz;
} troll;
int i, n, cf, cm, st, dr, pivot, poz, A;
long long m, pref[100005], suff[100005], rs, need, auxm, minAUX, minimal,
    b[100005];
troll a[100005];
bool cmp(const troll &a, const troll &b) { return a.x > b.x; }
bool Check(long long x, long long aux, int poz) {
  int st = poz, dr = n, pivot, q = -1;
  while (st <= dr) {
    pivot = (st + dr) / 2;
    if (a[pivot].x <= x)
      q = pivot, dr = pivot - 1;
    else
      st = pivot + 1;
  }
  return aux >= 1LL * (n - q + 1) * x - suff[q];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> A >> cf >> cm >> m;
  a[0].x = 1e18;
  for (i = 1; i <= n; ++i) cin >> a[i].x, a[i].poz = i;
  sort(a + 1, a + n + 1, cmp);
  for (i = 1; i <= n; ++i) {
    pref[i] = pref[i - 1] + a[i].x;
    suff[n - i + 1] = suff[n - i + 2] + a[n - i + 1].x;
  }
  for (i = 0; i <= n; ++i) {
    need = 1LL * i * A - pref[i];
    if (need > m) continue;
    auxm = m - need;
    st = minAUX = a[n].x;
    dr = A;
    while (st <= dr) {
      pivot = st + (dr - st) / 2;
      if (Check(pivot, auxm, i + 1))
        minAUX = pivot, st = pivot + 1;
      else
        dr = pivot - 1;
    }
    if (i == n) minAUX = A;
    if (1LL * i * cf + minAUX * cm > rs)
      rs = 1LL * i * cf + minAUX * cm, poz = i, minimal = minAUX;
  }
  for (i = 1; i <= n; ++i)
    if (i <= poz)
      b[a[i].poz] = A;
    else
      b[a[i].poz] = max(minimal, a[i].x);
  cout << rs << '\n';
  for (i = 1; i <= n; ++i) cout << b[i] << " \n"[i == n];
  return 0;
}
