#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first > b.first)
    return 1;
  else
    return 0;
}
int main() {
  cin.tie(0);
  ios_base ::sync_with_stdio(false);
  long long n, A, cofA, cofM, second, cnt = 0;
  cin >> n >> A >> cofA >> cofM >> second;
  vector<long long> b(n, 0), sum(n, 0);
  vector<pair<long long, long long> > a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
    b[i] = a[i].first;
    if (a[i].first == A) cnt++;
  }
  sort(a.begin(), a.end(), cmp);
  sort(b.begin(), b.end());
  vector<long long> pref(n, 0);
  for (int i = 0; i < n; i++) {
    pref[i] = pref[max(i - 1, 0)] + A - a[i].first;
    sum[i] = b[i] + sum[max(i - 1, 0)];
  }
  long long ans = 0, ansi = 0, ansm = 0;
  for (int i = cnt; i <= n; i++) {
    long long l = 0, r = A;
    while (l <= r) {
      long long cpS = second;
      if (i > 0) cpS = cpS - pref[i - 1];
      long long mid = (l + r) >> 1;
      long long tl = 0, tr = n - 1 - i;
      while (tl < tr) {
        long long tm = (tl + tr) >> 1;
        if (b[tm] > mid)
          tr = tm;
        else
          tl = tm + 1;
      }
      if (b[tl] > mid) tl--;
      tl = min(tl, tr);
      if (tl >= 0) cpS -= (mid * (tl + 1)) - sum[tl];
      if (cpS >= 0) {
        l = mid + 1;
        long long got = i * cofA + mid * cofM;
        if (got > ans) {
          ansi = i;
          ansm = mid;
          ans = got;
        }
      } else {
        if (l != r)
          r = mid;
        else
          l = r + 1;
      }
    }
  }
  vector<long long> answer(n, 0);
  cout << ans << endl;
  for (int i = 0; i < ansi; i++) answer[a[i].second] = A;
  for (int i = ansi; i < n; i++) answer[a[i].second] = max(a[i].first, ansm);
  for (int i = 0; i < n; i++) cout << answer[i] << " ";
}
