#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  ll A, cf, cm, m;
  cin >> n >> A >> cf >> cm >> m;
  vector<pair<ll, int>> a(n);
  for (int i = 0; i < n; i++) a[i].second = i;
  for (int i = 0; i < n; i++) cin >> a[i].first;
  sort(begin(a), end(a));
  vector<ll> need(n);
  for (int i = 1; i <= n - 1; i++) {
    need[i] = need[i - 1] + (a[i].first - a[i - 1].first) * i;
  }
  ll best = -1;
  int bi = -1, bj = -1;
  ll bh = -1;
  vector<ll> rneed(n + 1);
  for (int i = n; i >= 0; --i) {
    if (i < n) rneed[i] = A - a[i].first;
    if (i < n - 1) rneed[i] += rneed[i + 1];
    if (rneed[i] > m) break;
    int j;
    ll v, have;
    if (i > 0) {
      j = (int)distance(
          need.begin(),
          prev(upper_bound(need.begin(), need.begin() + i, m - rneed[i])));
      v = a[j].first;
      ll rem = m - rneed[i] - need[j];
      v = min(A, v + (rem / (j + 1)));
      have = v * cm + (n - i) * cf;
    } else {
      have = A * cm + n * cf;
      j = -1;
      v = -1;
    }
    if (have > best) {
      best = have;
      bi = i;
      bj = j;
      bh = v;
    }
  }
  cout << best << '\n';
  for (int i = 0; i < bj + 1; i++) {
    a[i].first = bh;
  }
  for (int i = n - 1; i >= bi; --i) {
    a[i].first = A;
  }
  vector<ll> res(n);
  for (int i = 0; i < n; i++) res[a[i].second] = a[i].first;
  for (int i = 0; i < n; i++) cout << res[i] << ' ';
  cout << '\n';
}
