#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 7;
const long long MOD = 1e9 + 7;
long long sign(long long a) {
  if (a == 0) return 0;
  return a / abs(a);
}
pair<long long, long long> a[MAX + 1];
pair<long long, pair<long long, long long>> ans;
long long sum[MAX], res[MAX], n, cf, cm, m, A;
int main() {
  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 (int 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 -= 1;
    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] << " ";
}
