#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100001;
pair<long long, long long> arr[MAXN];
long long n, a, cf, cm, m;
long long rangeSum[MAXN] = {
    0,
};
long long check(long long num) {
  return a * num - (rangeSum[n] - rangeSum[n - num]);
}
long long check2(long long num, long long mid) {
  return mid * num - (rangeSum[num] - rangeSum[0]);
}
int main() {
  long long mn = 1e9, mx = -1e9;
  long long mNum = 0;
  cin >> n >> a >> cf >> cm >> m;
  vector<long long> ret;
  ret.resize(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> arr[i].first;
    arr[i].second = i;
    mn = min(mn, arr[i].first);
    mx = max(mx, arr[i].first);
    if (arr[i].first == a) {
      mNum++;
    }
  }
  sort(arr + 1, arr + n + 1);
  for (int i = 1; i <= n; i++) {
    rangeSum[i] = rangeSum[i - 1] + arr[i].first;
  }
  long long ans = 0;
  long long l = 0;
  long long lsz = 0;
  long long hsz = 0;
  for (long long i = mNum; i <= n; i++) {
    long long cost = check(i);
    if (cost > m) continue;
    long long remain = m - cost;
    long long low = 0, high = a;
    while (low <= high) {
      long long mid = (low + high) / 2;
      long long sz =
          upper_bound(arr + 1, arr + n + 1, make_pair(mid, (long long)1e9)) -
          arr - 1;
      sz = min(n - i, sz);
      long long rr = check2(sz, mid);
      if (rr > remain) {
        high = mid - 1;
      } else {
        if (cm * mid + cf * i > ans) {
          ans = cm * mid + cf * i;
          l = mid;
          lsz = sz;
          hsz = i;
        }
        low = mid + 1;
      }
    }
  }
  cout << ans << endl;
  for (int i = 1; i <= lsz; i++) {
    arr[i].first = l;
  }
  for (long long i = n;; i--) {
    if (hsz == 0) break;
    arr[i].first = a;
    hsz--;
  }
  for (int i = 1; i <= n; i++) {
    ret[arr[i].second] = arr[i].first;
  }
  for (int i = 1; i <= n; i++) {
    cout << ret[i] << ' ';
  }
  return 0;
}
