#include <bits/stdc++.h>
using namespace std;
struct p {
  int x, num;
} a[101000];
long long sum1[101000];
long long sum2[101000];
long long cf, cm, m, A;
int n;
bool cmp(p q, p w) {
  if (q.x != w.x) return q.x > w.x;
  return q.num < w.num;
}
bool cmp1(p q, p w) { return q.num < w.num; }
int main() {
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i].x), a[i].num = i;
  sort(a + 1, a + 1 + n, cmp);
  for (int i = 1; i <= n; i++) sum1[i] = sum1[i - 1] + a[i].x;
  for (int i = n; i >= 1; i--) sum2[i] = sum2[i + 1] + a[i].x;
  if (cf == 0 && cm == 0) {
    cout << 0 << endl;
    sort(a + 1, a + 1 + n, cmp1);
    for (int i = 1; i <= n; i++) printf("%d ", a[i].x);
    return 0;
  }
  if (cm == 0) {
    long long ans = 0;
    for (int i = 1; i <= n; i++) {
      m -= (A - a[i].x);
      if (m >= 0) a[i].x = A, ans += cf;
    }
    cout << ans << endl;
    sort(a + 1, a + 1 + n, cmp1);
    for (int i = 1; i <= n; i++) printf("%d ", a[i].x);
    return 0;
  }
  if (cf == 0) {
    long long ans = 0;
    for (int i = 1; i <= n; i++) {
      if (m < ((long long)(n - i + 1) * a[i].x - sum2[i])) continue;
      long long t = m - ((long long)(n - i + 1) * a[i].x - sum2[i]);
      t = t / (n - i + 1);
      t = min(t + a[i].x, A);
      ans = t * cm;
      for (int j = i; j <= n; j++) a[j].x = t;
      break;
    }
    cout << ans << endl;
    sort(a + 1, a + 1 + n, cmp1);
    for (int i = 1; i <= n; i++) printf("%d ", a[i].x);
    return 0;
  }
  if (m >= (A * n) - sum1[n]) {
    long long ans = cf * n + cm * A;
    cout << ans << endl;
    for (int i = 1; i <= n; i++) printf("%lld ", A);
    return 0;
  }
  long long ans = -1, hh, num;
  int st = 0, ed;
  int l = 1;
  long long temp = -A;
  m += A;
  for (int i = 0; i < n; i++) {
    if (l <= i) l = i + 1;
    temp += (A - a[i].x);
    long long temp2 = 0;
    m -= (A - a[i].x);
    if (m < 0) break;
    long long res, ahh;
    for (; l <= n; l++) {
      if (m < ((long long)(n - l + 1) * a[l].x - sum2[l])) continue;
      long long t = m - ((long long)(n - l + 1) * a[l].x - sum2[l]);
      t = t / (n - l + 1);
      t = min(t + a[l].x, A);
      res = t * cm;
      temp2 = temp + (long long)(n - l + 1) * t - sum2[l];
      ahh = t;
      break;
    }
    if (ans < res + i * cf || (ans == res + i * cf && hh > temp2))
      ans = res + i * cf, hh = temp2, st = i, ed = l, num = ahh;
  }
  for (int i = 1; i <= st; i++) a[i].x = A;
  for (int i = ed; i <= n; i++) a[i].x = num;
  cout << ans << endl;
  sort(a + 1, a + 1 + n, cmp1);
  for (int i = 1; i <= n; i++) printf("%d ", a[i].x);
  return 0;
}
