#include <bits/stdc++.h>
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
constexpr long long INF = 1LL << 60;
constexpr int inf = 1000000007;
constexpr long long mod = 1000000007LL;
const long double PI = acos((long double)(-1));
using namespace std;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  long long n, A, cf, cm, m;
  cin >> n >> A >> cf >> cm >> m;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  auto b = a;
  sort(b.begin(), b.end());
  vector<long long> sum1(n + 1), sum2(n + 1);
  for (int i = 0; i < n; i++) sum1[i + 1] = sum1[i] + b[i];
  {
    vector<long long> v(n);
    for (int i = 0; i < n; i++) v[i] = A - b[i];
    sort(v.begin(), v.end());
    for (int i = 0; i < n; i++) sum2[i + 1] = sum2[i] + v[i];
  }
  if (sum2.back() <= m) {
    cout << cf * n + cm * A << endl;
    for (int i = 0; i < n; i++) cout << A << " \n"[i + 1 == n];
    return 0;
  }
  long long res = -1;
  int idx = -1;
  long long l = 0;
  for (int cnt = 0; cnt < n; cnt++) {
    long long r = m - sum2[cnt];
    if (r < 0) break;
    long long lf = 0;
    long long rg = n - cnt;
    while (rg - lf > 1) {
      long long mid = (lf + rg) >> 1;
      long long t = sum1[mid];
      long long p = b[mid] * mid - t;
      if (p > r)
        rg = mid;
      else
        lf = mid;
    }
    long long mn = b[lf] + (r - (b[lf] * lf - sum1[lf])) / (lf + 1);
    if (mn >= A) continue;
    if (chmax(res, cf * cnt + mn * cm)) idx = cnt, l = lf;
  }
  vector<pair<long long, int>> c(n);
  for (int i = 0; i < n; i++) c[i].first = a[i], c[i].second = i;
  sort(c.begin(), c.end());
  long long r = m - sum2[idx];
  long long mn = b[l] + (r - (b[l] * l - sum1[l])) / (l + 1);
  chmin(mn, A);
  for (int i = 0; i <= l; i++) c[i].first = mn;
  for (int i = n - idx; i < n; i++) c[i].first = A;
  vector<long long> ans(n);
  for (int i = 0; i < n; i++) ans[c[i].second] = c[i].first;
  cout << res << "\n";
  for (int i = 0; i < n; i++) cout << ans[i] << " \n"[i + 1 == n];
}
