#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 233;
const long long inf = 1e18 + 233;
struct zs {
  long long v, id;
} a[maxn];
long long b[maxn];
long long pre[maxn], aft[maxn];
int i, j, k, n, m;
long long CF, CM, rest, A;
int ra, fh;
char rx;
inline int read() {
  rx = getchar(), ra = 0, fh = 1;
  while ((rx < '0' || rx > '9') && rx != '-') rx = getchar();
  if (rx == '-') fh = -1, rx = getchar();
  while (rx >= '0' && rx <= '9') ra = ra * 10 + rx - 48, rx = getchar();
  return ra * fh;
}
inline long long get(int mx) {
  long long res = rest - (A * mx - aft[n - mx + 1]);
  if (res < 0) return -inf;
  int l = a[1].v, r = A, mid, l2, r2, m2;
  while (l < r) {
    mid = (l + r + 1) >> 1;
    l2 = 0, r2 = n - mx;
    while (l2 < r2) {
      m2 = (l2 + r2 + 1) >> 1;
      if (a[m2].v < mid)
        l2 = m2;
      else
        r2 = m2 - 1;
    }
    long long tmp = 1ll * mid * l2 - pre[l2];
    if (tmp > res)
      r = mid - 1;
    else
      l = mid;
  }
  return CM * l + CF * mx;
}
inline int get2(int mx) {
  long long res = rest - (A * mx - aft[n - mx + 1]);
  int l = a[1].v, r = A, mid, l2, r2, m2;
  while (l < r) {
    mid = (l + r + 1) >> 1;
    l2 = 0, r2 = n - mx;
    while (l2 < r2) {
      m2 = (l2 + r2 + 1) >> 1;
      if (a[m2].v < mid)
        l2 = m2;
      else
        r2 = m2 - 1;
    }
    long long tmp = 1ll * mid * l2 - pre[l2];
    if (tmp > res)
      r = mid - 1;
    else
      l = mid;
  }
  return l;
}
bool operator<(zs a, zs b) { return a.v < b.v; }
int main() {
  n = read();
  A = read(), CF = read(), CM = read();
  scanf("%I64d", &rest);
  for (i = 1; i <= n; i++) a[i].v = b[i] = read(), a[i].id = i;
  sort(a + 1, a + 1 + n);
  for (i = 1; i <= n; i++) pre[i] = pre[i - 1] + a[i].v;
  for (i = n; i; i--) aft[i] = aft[i + 1] + a[i].v;
  long long ans = get(0), tmp;
  int mx = 0;
  for (i = 1; i <= n; i++)
    if ((tmp = get(i)) > ans) ans = tmp, mx = i;
  printf("%I64d\n", ans);
  int mn = get2(mx);
  for (i = 1; i <= n; i++)
    if (b[i] < mn) b[i] = mn;
  for (i = n - mx + 1; i <= n; i++) b[a[i].id] = A;
  for (i = 1; i <= n; i++) rest -= b[a[i].id] - a[i].v;
  for (i = 1; i <= n && rest; i++)
    if (b[i] < A) j = min(rest, A - b[i]), b[i] += j, rest -= j;
  for (i = 1; i <= n; i++) printf("%I64d ", b[i]);
}
