#include <bits/stdc++.h>
using namespace std;
struct node {
  long long list, pre;
  int id;
  bool operator<(const node &a) const { return list < a.list; }
} p[2000010];
int cmp(node a, node b) { return a.id < b.id; }
int n;
long long A, cf, cm, m;
long long ans = 0;
int main(int argc, char const *argv[]) {
  scanf("%d%I64d%I64d%I64d%I64d", &n, &A, &cf, &cm, &m);
  int NN = n;
  for (int i = 0; i < n; i++) {
    p[i].id = i;
    p[i].pre = 0;
    scanf("%I64d", &p[i].list);
  }
  sort(p, p + n);
  p[0].pre = p[0].list;
  for (int i = 1; i < n; i++) p[i].pre = p[i - 1].pre + p[i].list;
  while (n > 0 && p[n - 1].list == A) {
    ans += cf;
    n--;
  }
  if (n == 0) {
    printf("%I64d\n", ans + cm * A);
    for (int i = 0; i < NN; i++) printf("%I64d ", A);
    return 0;
  }
  long long M = -1, s1 = 0, s2 = 0, sl = 0, sm = 0;
  for (int i = n - 1; i >= 0; i--) {
    int L = 0, R = i + 1, mid;
    while (L < R - 1) {
      int mid = (L + R) / 2;
      if (p[mid].list * (mid + 1) - p[mid].pre <= m)
        L = mid;
      else
        R = mid;
    }
    long long tp = min(
        A - 1, (p[L].list + (m - p[L].list * (L + 1) + p[L].pre) / (L + 1)));
    long long tmp = (n - i - 1) * cf + tp * cm;
    if (tmp > M) {
      M = tmp;
      s1 = i;
      s2 = tp;
      sl = L;
      sm = m;
    }
    m = m - (A - p[i].list);
    if (m < 0) break;
  }
  if (m >= 0) {
    if (n * cf + A * cm > M) {
      sl = -1;
      s1 = -1;
      M = n * cf + A * cm;
    }
  }
  printf("%I64d\n", ans + M);
  for (int i = 0; i <= sl; i++) p[i].list = s2;
  for (int i = s1 + 1; i < NN; i++) p[i].list = A;
  sort(p, p + NN, cmp);
  for (int i = 0; i < NN; i++) printf("%I64d ", p[i].list);
  return 0;
}
