#include <bits/stdc++.h>
using namespace std;
int n, A, cf, cm;
long long m;
long long h[100010], l[100010];
struct node {
  int a;
  int idx;
} nd[100010];
bool cmp(const node& A, const node& B) { return A.a < B.a; }
bool cmp_by_idx(const node& A, const node& B) { return A.idx < B.idx; }
int main() {
  while (scanf("%d%d%d%d%I64d", &n, &A, &cf, &cm, &m) != EOF) {
    for (int i = 1; i <= n; ++i) {
      scanf("%d", &nd[i].a);
      nd[i].idx = i;
    }
    nd[n + 1].a = A;
    nd[n + 1].idx = n + 1;
    sort(nd + 1, nd + n + 1, cmp);
    h[n + 1] = 0;
    for (int i = n; i >= 1; --i) h[i] = h[i + 1] + (A - nd[i].a);
    l[1] = 0;
    for (int i = 2; i <= n; ++i) {
      l[i] = l[i - 1] + (long long)(nd[i].a - nd[i - 1].a) * (i - 1);
    }
    l[n + 1] = l[n] + (long long)(n - nd[n].a) * n;
    int idx_height = n + 1, idx_low = -1;
    long long ans = -1;
    for (int i = n + 1; i >= 1; --i) {
      if (h[i] > m) break;
      long long m_left = m - h[i];
      int left = 1, right = i - 1, xidx = -1;
      while (left <= right) {
        int mid = (left + right) / 2;
        if (l[mid] <= m_left) {
          xidx = mid;
          left = mid + 1;
        } else
          right = mid - 1;
      }
      m_left -= l[xidx];
      long long xa = nd[xidx].a;
      if (i == 1) {
        xa = A;
      } else {
        if (xa < A) {
          long long da = m_left / xidx;
          xa += da;
          if (xa > A) xa = A;
        }
      }
      long long tmp = (long long)cf * (n + 1 - i) + xa * cm;
      if (tmp > ans) {
        ans = tmp;
        idx_height = i;
        idx_low = xa;
      }
    }
    for (int i = n; i >= idx_height; --i) nd[i].a = A;
    for (int i = 1; i <= n; ++i)
      if (nd[i].a < idx_low) nd[i].a = idx_low;
    sort(nd + 1, nd + 1 + n, cmp_by_idx);
    printf("%I64d\n", ans);
    for (int i = 1; i <= n; ++i) printf("%d%c", nd[i].a, (i == n) ? '\n' : ' ');
  }
  return 0;
}
