#include <bits/stdc++.h>
using namespace std;
long long n, m, cm, cf, ans, L, R, o[200005], aa, sum[200005];
struct wf {
  long long v, pos;
} a[200005];
bool cmp(wf a, wf b) {
  if (a.v != b.v) return a.v < b.v;
  return a.pos < b.pos;
}
long long work(long long m, long long x) {
  long long l = 0, r = aa, ans = 0;
  while (l <= r) {
    long long mid = l + r >> 1;
    long long w = lower_bound(a + 1, a + n + 1, (wf){mid, 0}, cmp) - a - 1;
    if (x <= w + 1) w = x - 1;
    if (m >= w * mid - sum[w]) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  return ans;
}
int main() {
  scanf("%lld%lld%lld%lld%lld", &n, &aa, &cf, &cm, &m);
  for (long long i = 1; i <= n; ++i) {
    a[i].pos = i;
    scanf("%lld", &a[i].v);
  }
  sort(a + 1, a + n + 1, cmp);
  for (long long i = 1; i <= n; ++i) sum[i] = sum[i - 1] + a[i].v;
  L = work(m, n + 1);
  ans = cm * L;
  R = n + 1;
  long long cnt = 0;
  for (long long i = n; i >= 1; --i) {
    m -= aa - a[i].v;
    ++cnt;
    if (m >= 0) {
      long long mn = work(m, i);
      if (ans < mn * cm + cf * cnt) {
        ans = cnt * cf + mn * cm;
        L = mn, R = i;
      }
    }
  }
  printf("%lld\n", ans);
  for (long long i = 1; i <= n; ++i) {
    if (R <= i)
      o[a[i].pos] = aa;
    else if (L >= a[i].v)
      o[a[i].pos] = L;
    else
      o[a[i].pos] = a[i].v;
  }
  for (long long i = 1; i <= n; ++i) printf("%lld ", o[i]);
  return 0;
}
