#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 9;
pair<long long, long long> a[MAX];
pair<long long, pair<long long, long long> > ans;
int main() {
  long long sum[MAX], res[MAX], n, cf, cm, m, A;
  cin >> n >> A >> cf >> cm >> m;
  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++) sum[i] = sum[i - 1] + a[i].first;
  long long p = n;
  for (long long i = 0; i <= n; i++) {
    long long d = m - i * A + sum[n] - sum[n - i];
    if (d < 0) break;
    p = min(p, n - i);
    while (p > 1 && d < p * a[p].first - sum[p]) p--;
    d -= p * a[p].first - sum[p];
    long long k = min(A, i == n ? A : (a[p].first + d / p));
    ans = max(ans, {i * cf + k * cm, {i, k}});
  }
  cout << ans.first << endl;
  for (int i = 0; i < ans.second.first; i++) a[n - i].first = A;
  for (int i = 1; i <= n; i++)
    a[i].first = max(a[i].first, ans.second.second),
    res[a[i].second] = a[i].first;
  for (int i = 1; i <= n; i++) cout << res[i] << " ";
}
