#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  long long n, A, cf, cm, q;
  cin >> n >> A >> cf >> cm >> q;
  vector<pair<long long, int>> a(n);
  for (auto &i : a) cin >> i.first, i.second = &i - &a[0];
  sort(a.begin(), a.end());
  a.insert(a.begin(), {0, -1});
  vector<long long> b(n + 1);
  for (int i = 1; i <= n; ++i) b[i] = a[i].first + b[i - 1];
  long long ans = -1, w, sq;
  for (int i = n; i >= 0; --i) {
    if (i + 1 <= n) q -= A - a[i + 1].first;
    if (q < 0) break;
    long long mn = A;
    if (i > 0) {
      int l = 1, r = i;
      while (l < r) {
        int md = (l + r + 1) >> 1;
        if (a[md].first * md - b[md] <= q)
          l = md;
        else
          r = md - 1;
      }
      mn = min(A, (q + b[l]) / l);
    }
    long long cost = (n - i) * cf + mn * cm;
    if (cost > ans) ans = cost, w = i, sq = q;
  }
  cout << ans << "\n";
  for (int i = w + 1; i <= n; ++i) a[i].first = A;
  long long mn = A;
  if (w > 0) {
    int l = 1, r = w;
    while (l < r) {
      int md = (l + r + 1) >> 1;
      if (a[md].first * md - b[md] <= sq)
        l = md;
      else
        r = md - 1;
    }
    mn = min(A, (sq + b[l]) / l);
  }
  for (int i = 1; i <= w; ++i) a[i].first = max(a[i].first, mn);
  a.erase(a.begin());
  sort(a.begin(), a.end(), [](pair<long long, int> x, pair<long long, int> y) {
    return x.second < y.second;
  });
  for (auto &i : a) cout << i.first << " \n"[&i == &a.back()];
  return 0;
}
