#include <bits/stdc++.h>
using namespace std;
struct node {
  long long num, id;
} a[100010];
bool cmp1(node x, node y) { return x.num > y.num; }
bool cmp2(node x, node y) { return x.id < y.id; }
long long sum[100010], ne[100010], need[100010];
int main() {
  long long n, A, cf, cm, m;
  while (scanf("%lld%lld%lld%lld%lld", &n, &A, &cf, &cm, &m) != EOF) {
    for (long long i = 1; i <= n; i++) {
      scanf("%lld", &a[i].num);
      a[i].id = i;
    }
    sort(a + 1, a + n + 1, cmp1);
    sum[0] = 0;
    for (long long i = 1; i <= n; i++) sum[i] = sum[i - 1] + A - a[i].num;
    ne[n] = 0;
    for (long long i = n - 1; i >= 1; i--)
      ne[i] = ne[i + 1] + (a[i].num - a[i + 1].num) * (n - i);
    for (long long i = 1; i <= n; i++) need[i] = ne[n - i + 1];
    long long ans = -1, minval, minnum, maxnum;
    for (long long i = 0; i <= n; i++) {
      long long M = m;
      if (sum[i] > M) break;
      if (i == n) {
        long long tem = n * cf + A * cm;
        if (ans < tem) {
          ans = tem;
          minnum = n;
          minval = A;
          maxnum = n;
        }
        break;
      }
      M -= sum[i];
      long long pos = upper_bound(need + 1, need + n + 1, M) - need;
      pos--;
      if (pos >= n - i) {
        long long x = n - i;
        M -= need[x];
        long long y = a[i + 1].num + M / x;
        long long tem = i * cf + min(y, A) * cm;
        if (tem > ans) {
          maxnum = i;
          ans = tem;
          minnum = x;
          minval = min(y, A);
        }
      } else {
        long long x = pos;
        M -= need[pos];
        long long y = a[n - pos + 1].num + M / x;
        long long tem = i * cf + y * cm;
        if (tem > ans) {
          maxnum = i;
          ans = tem;
          minnum = x;
          minval = y;
        }
      }
    }
    printf("%lld\n", ans);
    for (long long i = 1; i <= maxnum; i++) a[i].num = A;
    for (long long i = n; i >= n - minnum + 1; i--) a[i].num = minval;
    sort(a + 1, a + n + 1, cmp2);
    for (long long i = 1; i < n; i++) printf("%lld ", a[i].num);
    printf("%lld\n", a[n].num);
  }
  return 0;
}
