#include <bits/stdc++.h>
using namespace std;
struct __timestamper {};
long long A;
long long get_minval(vector<pair<long long, long long>>& cur,
                     vector<long long>& psum, long long& r, long long n,
                     long long m) {
  while (r > 0) {
    long long id = r - 1;
    long long mid = cur[id].first;
    if (mid * id - psum[id] <= m)
      break;
    else
      r--;
  }
  long long limit = (r == n) ? A : cur[r].first;
  return (int)(min(limit, (m + psum[r]) / r));
}
int main() {
  long long n, cf, cm, m;
  scanf("%lld %lld %lld %lld %lld", &n, &A, &cf, &cm, &m);
  vector<pair<long long, long long>> cur(n);
  for (int i = 0; i < n; i++) {
    int temp;
    scanf("%d", &temp);
    cur[i].first = temp;
    cur[i].second = i;
  }
  sort(cur.begin(), cur.end());
  vector<long long> psum(n + 1);
  for (int i = 0; i < n; i++) {
    psum[i + 1] = psum[i] + cur[i].first;
  }
  long long r = n;
  long long ans_val = get_minval(cur, psum, r, n, m);
  long long answer = ans_val * cm;
  if (m + psum[n] >= n * A) {
    ans_val = A;
    answer = n * cf + A * cm;
  } else {
    long long mbak = m;
    for (long long i = n - 1; i >= 0; i--) {
      m -= A - cur[i].first;
      if (m < 0) break;
      r = min(r, i);
      long long cur_val = i == 0 ? A : get_minval(cur, psum, r, i, m);
      long long cur_ans = cur_val * cm + (n - i) * cf;
      if (cur_ans > answer) {
        answer = cur_ans;
        ans_val = cur_val;
      }
    }
    m = mbak;
  }
  printf("%lld\n", answer);
  for (long long i = 0; i < n; i++) {
    long long dlt = max(0LL, ans_val - cur[i].first);
    m -= dlt;
    cur[i].first += dlt;
  }
  for (long long i = n - 1; i >= 0; i--) {
    long long dlt = min(m, A - cur[i].first);
    m -= dlt;
    cur[i].first += dlt;
  }
  sort(cur.begin(), cur.end(),
       [](const pair<long long, long long>& a,
          const pair<long long, long long>& b) { return a.second < b.second; });
  for (long long i = 0; i < n; i++) printf("%d ", (int)cur[i].first);
  return 0;
}
