#include <bits/stdc++.h>
using namespace std;
inline long long gcd(long long x, long long y) { return x ? gcd(y % x, x) : y; }
const long long mod = 1e9 + 7;
inline long long QPow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
long long exgcd(long long a, long long b, long long &x, long long &y) {
  long long d = a;
  if (b == 0)
    x = 1, y = 0;
  else {
    d = exgcd(b, a % b, y, x), y -= a / b * x;
  }
  return d;
}
const long long maxn = 100005;
long long arr[maxn];
long long pre[maxn];
long long presum[maxn];
pair<signed, signed> p[maxn];
long long Ans[maxn];
signed main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long t;
  long long n, l, m, A, cf, cm;
  cin >> n >> A >> cf >> cm >> m;
  for (long long i = 1; i <= n; i++) cin >> arr[i], p[i] = {arr[i], i};
  sort(arr + 1, arr + 1 + n);
  sort(p + 1, p + 1 + n);
  long long ptr = n;
  while (arr[ptr] == A) ptr--;
  if (ptr == 0) {
    cout << cm * A + n * cf << endl;
    for (long long i = 1; i <= n; i++) cout << A << ' ';
    cout << endl;
  } else {
    long long tot = arr[1];
    presum[1] = tot;
    long long ans1 = n + 1, ans2 = 0, ans3 = 0, ans4 = 0;
    for (long long i = 2; i <= n; i++) {
      tot += arr[i];
      presum[i] = tot;
      pre[i] = arr[i] * i - tot;
    }
    long long cur = (n - ptr) * cf;
    long long ans = (n - ptr) * cf + cm * arr[1];
    arr[n + 1] = A;
    presum[n + 1] = A + presum[n];
    for (long long i = ptr + 1; i >= 1; i--) {
      m -= A - arr[i];
      if (m > 0) {
        pre[i + 1] = A * i - presum[i];
        arr[i] = A;
        signed id = upper_bound(pre + 1, pre + i, m) - pre;
        if (id == 1) {
          ans = cm * A + n * cf;
          ans1 = 1;
          ans2 = 0;
          break;
        }
        long long tmp = (m - pre[id - 1]) / (id - 1) + arr[id - 1];
        tmp = min(tmp, A);
        if (i <= ptr) cur += cf;
        tmp = (tmp * cm + cur);
        if (ans < tmp) {
          ans = tmp;
          ans1 = i;
          ans2 = id - 1;
          ans4 = (m - pre[id - 1]) / (id - 1) + arr[id - 1];
        }
      } else
        break;
    }
    cout << ans << endl;
    if (ans == 0) {
      for (long long i = 1; i <= n; i++) Ans[p[i].second] = p[i].first;
    } else {
      for (long long i = ans1; i <= n; i++) p[i].first = A;
      for (long long i = 1; i <= ans2; i++) p[i].first = ans4;
      for (long long i = 1; i <= n; i++) Ans[p[i].second] = p[i].first;
    }
    for (long long i = 1; i <= n; i++) cout << min(A, Ans[i]) << ' ';
    cout << endl;
  }
  return 0;
}
