#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const double pi = acos(-1);
struct sy {
  int a, d, id;
  sy(int a = 0, int d = 0, int id = 0) : a(a), d(d), id(id) {}
} a[100001], best[100001];
long long cost[100001];
int n, A, cf, cm;
long long m;
bool cmp(sy x, sy y) { return x.a > y.a; }
bool cmp2(sy x, sy y) { return x.id < y.id; }
long long findcost(int L, long long price, int& pos, int& mini) {
  int l = L, r = n;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (cost[mid] > price)
      l = mid + 1;
    else
      r = mid;
  }
  while (cost[l] <= price && l >= L) l--;
  pos = ++l;
  mini = min(A, int(a[l].a + (price - cost[l]) / (n - l + 1)));
  return (1ll * mini * cm);
}
int main() {
  scanf("%d%d%d%d%I64d", &n, &A, &cf, &cm, &m);
  int t;
  long long qqq = 0;
  for (int i = 1; i <= n; i++)
    scanf("%d", &t), a[i] = sy(t, t, i), qqq += A - t;
  if (qqq <= m) {
    printf("%I64d\n", 1ll * cf * n + 1ll * cm * A);
    for (int i = 1; i <= n; i++) printf("%d ", A);
    return 0;
  }
  sort(a + 1, a + n + 1, cmp);
  cost[n] = 0;
  for (int i = n - 1; i > 0; i--)
    cost[i] = cost[i + 1] + (a[i].a - a[i + 1].a) * (n - i);
  int Ptm = n, mim;
  long long Ans = findcost(1, m, Ptm, mim), tmp = m;
  int Atm = 0;
  for (int i = 1; i <= n; i++) {
    tmp -= (A - a[i].a);
    if (tmp < 0) break;
    int k, q;
    long long b = i * cf + findcost(i + 1, tmp, k, q);
    if (b > Ans) Atm = i, Ans = b, Ptm = k, mim = q;
  }
  int Tmp = m;
  for (int i = 1; i <= Atm; i++) Tmp -= A - a[i].a, a[i].a = A;
  for (int i = Ptm; i <= n; i++) a[i].a = mim;
  sort(a + 1, a + n + 1, cmp2);
  printf("%I64d\n", Ans);
  for (int i = 1; i <= n; i++) printf("%d ", a[i].a);
}
