#include <bits/stdc++.h>
int B = 400;
using namespace std;
const long long inf = 1e17;
int MOD = 1e9 + 7;
const int mxn = 100010;
const int N = 1000005;
const double pi = 3.14159;
int dx[] = {0, 1, 0, -1, 1, -1, 1, -1};
int dy[] = {1, 0, -1, 0, -1, 1, 1, -1};
long long n, A, cf, cm, T;
pair<long long, long long> a[mxn];
long long pref[mxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> A >> cf >> cm >> T;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first, a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) pref[i] += pref[i - 1] + a[i].first;
  int l = 1, r = 1;
  while ((T - (A * (n - r + 1) - (pref[n] - pref[r - 1]))) < 0 && r <= n) r++;
  long long rem = (T - (A * (n - r + 1) - (pref[n] - pref[r - 1])));
  while (rem > a[l].first * l - pref[l] && l < r && l < n + 1) l++;
  l--;
  long long ans = (l > 0 ? min((rem + pref[l]) / (l), A) * cm
                         : (T > 0 ? A * cm : a[1].first * cm)) +
                  (n - r + 1) * cf;
  int l_ = l, r_ = r, x = (ans - (n - r + 1) * cf) / cm;
  while (l < r && r < n + 1) {
    r++;
    rem = (T - (A * (n - r + 1) - (pref[n] - pref[r - 1])));
    while (rem > a[l].first * l - pref[l] && l < r && l < n + 1) l++;
    l--;
    if ((min(((rem + pref[l]) / l), A) * cm + (n - r + 1) * cf) > ans)
      ans = (min(((rem + pref[l]) / l), A) * cm + (n - r + 1) * cf), l_ = l,
      r_ = r, x = (min(((rem + pref[l]) / l), A));
  }
  cout << ans << endl;
  int res[mxn];
  for (int i = 1; i <= l_; i++) res[a[i].second] = x;
  for (int i = l_ + 1; i < r_; i++) res[a[i].second] = a[i].first;
  for (int i = r_; i <= n; i++) res[a[i].second] = A;
  for (int i = 1; i <= n; i++) cout << res[i] << ' ';
}
