#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
pair<int, int> skill[MAXN], ans;
long long sum[MAXN], tans;
int n, A;
long long cf, cm, m, tm;
bool check(int mid, int tlen) {
  auto it =
      upper_bound(skill + 1, skill + n + 1, make_pair(mid, 0),
                  [&](const pair<int, int>& t1, const pair<int, int>& t2) {
                    return t1.first < t2.first;
                  });
  it--;
  auto len = it - skill;
  if (len + tlen > n) len = n - tlen;
  long long tsum = (long long)mid * len - sum[len];
  return tsum <= tm;
}
int main() {
  scanf("%d%d%lld%lld%lld", &n, &A, &cf, &cm, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &skill[i].first);
    skill[i].second = i;
  }
  sort(skill + 1, skill + n + 1);
  sum[1] = skill[1].first;
  for (int i = 2; i <= n; i++) {
    sum[i] = sum[i - 1] + skill[i].first;
  }
  tans = 0;
  for (int len = 0; len <= n; len++) {
    long long now = (long long)len * (long long)A - (sum[n] - sum[n - len]);
    if (now > m) break;
    tm = m - now;
    if (len == n) {
      ans.first = A;
      ans.second = n;
      tans = (long long)A * cm + (long long)n * cf;
    } else {
      int L = skill[1].first, R = A, mid;
      while (L < R - 3) {
        mid = (L + R) >> 1;
        if (check(mid, len)) {
          L = mid;
        } else {
          R = mid;
        }
      }
      for (mid = L; mid <= R; mid++) {
        if (check(mid, len) &&
            (long long)mid * cm + (long long)len * cf > tans) {
          ans.first = mid;
          ans.second = len;
          tans = (long long)mid * cm + (long long)len * cf;
        }
      }
    }
  }
  printf("%lld\n", tans);
  if (ans.second == n) {
    for (int i = 1; i <= n; i++) {
      printf("%d%c", ans.first, i == n ? '\n' : ' ');
    }
  } else {
    for (int i = n; i > n - ans.second; i--) {
      skill[i].first = A;
    }
    for (int i = 1; i <= n && skill[i].first <= ans.first; i++) {
      skill[i].first = ans.first;
    }
    sort(skill + 1, skill + n + 1,
         [&](const pair<int, int>& t1, const pair<int, int>& t2) {
           return t1.second < t2.second;
         });
    for (int i = 1; i <= n; i++) {
      printf("%d%c", skill[i].first, i == n ? '\n' : ' ');
    }
  }
  return 0;
}
