#include <bits/stdc++.h>
using namespace std;
struct pozS {
  long long val, id;
  pozS(long long val, long long id) {
    this->val = val;
    this->id = id;
  }
  pozS() {}
  bool operator<(pozS b) const { return val < b.val; }
  bool operator<=(pozS b) const { return val <= b.val; }
};
long long n, maxi, cf, cm, bani, cbani, i;
long long nans, ans, ansi, ansm;
long long st, dr, mij, last;
pozS a[100005];
long long ansv[100005];
long long s[100005];
bool ok(long long val, long long bani) {
  long long p = lower_bound(a + 1, a + n + 1, pozS(val, 0)) - a;
  p--;
  if (p == 0) return true;
  p = min(p, n - i);
  return (val * p - s[p]) <= bani;
}
int main() {
  cin >> n >> maxi >> cf >> cm >> bani;
  cbani = bani;
  for (i = 1; i <= n; i++) {
    cin >> a[i].val;
    a[i].id = i;
  }
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) s[i] = s[i - 1] + a[i].val;
  for (i = 0; i <= n; i++) {
    bani = cbani;
    if (i * maxi - s[n] + s[n - i] > bani) break;
    bani -= i * maxi - s[n] + s[n - i];
    nans = i * cf;
    last = a[1].val;
    st = a[1].val;
    dr = maxi;
    while (st <= dr) {
      mij = (st + dr) / 2;
      if (ok(mij, bani)) {
        last = mij;
        st = mij + 1;
      } else
        dr = mij - 1;
    }
    nans += last * cm;
    if (nans > ans) {
      ans = nans;
      ansi = i;
      ansm = last;
    }
  }
  cout << ans << '\n';
  for (i = 1; i <= n; i++) {
    ansv[a[i].id] = a[i].val;
    if (a[i].val < ansm) ansv[a[i].id] = ansm;
    if (i > n - ansi) ansv[a[i].id] = maxi;
  }
  for (i = 1; i <= n; i++) cout << ansv[i] << ' ';
  return 0;
}
