#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[100100];
int n, A, cf, cm, b[100100], ct, mm;
long long m, pre[100100], suf[100100], Ans;
int main() {
  scanf("%d%d%d%d%I64d", &n, &A, &cf, &cm, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i].first), a[i].second = i;
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) pre[i] = pre[i - 1] + a[i].first;
  for (int i = n; i >= 1; i--) suf[i] = suf[i + 1] + a[i].first;
  for (int i = 0; i <= n - 1; i++)
    if (m >= 1LL * i * A - suf[n - i + 1]) {
      long long tmp = m - 1LL * i * A + suf[n - i + 1];
      int l = a[1].first, r = A - 1, mn = a[1].first;
      while (l <= r) {
        int mid = l + r >> 1;
        int pos = min(
            n - i,
            (int)(upper_bound(a + 1, a + n + 1, make_pair(mid, 0)) - a - 1));
        if (tmp >= 1LL * mid * pos - pre[pos])
          mn = mid, l = mid + 1;
        else
          r = mid - 1;
      }
      if (Ans < 1LL * mn * cm + 1LL * i * cf)
        Ans = 1LL * mn * cm + 1LL * i * cf, ct = i, mm = mn;
    }
  if (m >= 1LL * A * n - pre[n] && Ans < 1LL * cf * n + 1ll * cm * A) {
    printf("%I64d\n", 1LL * n * cf + 1LL * cm * A);
    for (int i = 1; i <= n; i++) printf("%d ", A);
    return 0;
  }
  printf("%I64d\n", Ans);
  for (int i = 1; i <= n; i++) b[a[i].second] = a[i].first;
  for (int i = 1; i <= ct; i++) b[a[n - i + 1].second] = A;
  int pos = min(n - ct,
                (int)(upper_bound(a + 1, a + n + 1, make_pair(mm, 0)) - a - 1));
  for (int i = 1; i <= pos; i++) b[a[i].second] = mm;
  for (int i = 1; i <= n; i++) printf("%d ", b[i]);
}
