#include <bits/stdc++.h>
using namespace std;
int n, d[100001], sv1, sv2;
long long cm, m, first, cf, a[100001], f, l, mi1, mi2, delta[100001], free1,
    free2, ct1, ct2, sc1, sc2, b[100001];
bool cmp1(int i, int j) { return delta[i] < delta[j]; }
int main() {
  scanf("%d", &n);
  scanf("%I64d %I64d%I64d%I64d", &first, &cf, &cm, &m);
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  for (int i = 0; i < n; i++) delta[i] = first - a[i], d[i] = i;
  sort(d, d + n, cmp1);
  f = 0;
  l = n - 1;
  while (f < l) {
    if (f == l - 1)
      mi1 = f, mi2 = l;
    else
      mi1 = (2 * f + l) / 3, mi2 = (2 * l + f) / 3;
    free1 = free2 = 0;
    ct1 = ct2 = 0ll;
    sv1 = sv2 = 0;
    for (int i = 0; i < n; i++) b[d[i]] = a[d[i]];
    for (int i = 0; i < mi1; i++) free1 += delta[d[i]], b[d[i]] = first;
    if (free1 > m)
      sc1 = -1;
    else {
      int i = n - 1;
      for (; i > 0 && free1 <= m && b[d[i - 1]] != first; i--) {
        if (free1 + 1ll * (n - 1 - i + 1) * (b[d[i - 1]] - b[d[i]]) <= m) {
          free1 += 1ll * (n - 1 - i + 1) * (b[d[i - 1]] - b[d[i]]);
          ct1 = b[d[i - 1]];
        } else {
          break;
        }
      }
      if ((m - free1) / (n - 1 - i + 1) < first - b[d[i]]) {
        ct1 += min((m - free1) / (n - 1 - i + 1), first - b[d[i]]);
        sc1 = mi1 * cf + cm * ct1;
      } else {
        ct1 += first - b[d[i]];
        sc1 = (mi1 + (n - 1 - i + 1)) * cf + cm * ct1;
      }
    }
    for (int i = 0; i < n; i++) b[d[i]] = a[d[i]];
    for (int i = 0; i < mi2; i++) free2 += delta[d[i]], b[d[i]] = first;
    if (free2 > m)
      sc2 = -1;
    else {
      int i = n - 1;
      for (; i > 0 && free2 <= m && b[d[i - 1]] != first; i--) {
        if (free2 + 1ll * (n - 1 - i + 1) * (b[d[i - 1]] - b[d[i]]) <= m) {
          free2 += 1ll * (n - 1 - i + 1) * (b[d[i - 1]] - b[d[i]]);
          ct2 = b[d[i - 1]];
        } else {
          break;
        }
      }
      if ((m - free2) / (n - 1 - i + 1) < first - b[d[i]]) {
        ct2 += min((m - free2) / (n - 1 - i + 1), first - b[d[i]]);
        sc2 = mi2 * cf + cm * ct2;
      } else {
        ct2 += first - b[d[i]];
        sc2 = (mi2 + (n - 1 - i + 1)) * cf + cm * ct2;
      }
    }
    if (sc2 == -1)
      l = mi2 - 1;
    else if (sc1 > sc2)
      l = mi2 - 1;
    else
      f = mi1 + 1;
  }
  free1 = 0ll;
  for (int i = 0; i < n; i++) b[d[i]] = a[d[i]];
  for (int i = 0; i < f; i++) free1 += delta[d[i]], b[d[i]] = first;
  if (free1 > m)
    sc1 = -1;
  else {
    int i = n - 1;
    ct1 = b[d[n - 1]];
    for (; i > 0 && free1 <= m && b[d[i - 1]] != first; i--) {
      if (free1 + 1ll * (n - 1 - i + 1) * (b[d[i - 1]] - b[d[i]]) <= m) {
        free1 += 1ll * (n - 1 - i + 1) * (b[d[i - 1]] - b[d[i]]);
        ct1 = b[d[i - 1]];
      } else {
        break;
      }
    }
    if ((m - free1) / (n - 1 - i + 1) < first - b[d[i]]) {
      ct1 += min((m - free1) / (n - 1 - i + 1), first - b[d[i]]);
      sc1 = f * cf + cm * ct1;
    } else {
      ct1 += first - b[d[i]];
      sc1 = (f + (n - 1 - i + 1)) * cf + cm * ct1;
    }
  }
  printf("%I64d\n", sc1);
  for (int i = 0; i < n; i++)
    if (b[i] <= ct1) b[i] = ct1;
  for (int i = 0; i < n; i++) printf("%I64d ", b[i]);
  return 0;
}
