#include <bits/stdc++.h>
const int mod = 1e9 + 7;
using namespace std;
struct node {
  long long val;
  int wei;
} num[100010];
long long sum[100010];
long long n, a, cf, cm, m;
bool cmpv(node a, node b) { return a.val > b.val; }
bool cmpw(node a, node b) { return a.wei < b.wei; }
int sear(int l, int r, long long m) {
  if (l == r) return l;
  if (l > r) return r;
  int mid = (l + r) / 2;
  long long f = sum[mid] + m;
  int id = n - mid + 1;
  long long ff = min(f / id, a);
  if (ff > num[mid].val)
    sear(l, mid, m);
  else if (ff < num[mid].val)
    sear(mid + 1, r, m);
  else
    return mid;
}
int main() {
  while (scanf("%I64d %I64d %I64d %I64d %I64d", &n, &a, &cf, &cm, &m) != EOF) {
    memset(num, 0, sizeof(num));
    memset(sum, 0, sizeof(sum));
    long long ans_cnt = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%I64d", &num[i].val);
      if (num[i].val == a) ans_cnt++;
      num[i].wei = i;
    }
    sort(num + 1, num + n + 1, cmpv);
    for (int i = n; i >= 1; i--) {
      if (i == n)
        sum[i] = num[i].val;
      else
        sum[i] = num[i].val + sum[i + 1];
    }
    long long cnt = 0, mm = 0, small = 0, ans = 0, big = 0;
    long long ans_small = num[n].val;
    for (int i = 0; i <= n; i++) {
      cnt = i;
      if (cnt == 0)
        mm = m;
      else
        mm = m - (a * cnt - sum[1] + sum[cnt + 1]);
      if (mm <= 0) break;
      if (cnt + 1 > n)
        small = a;
      else {
        int h = sear(cnt + 1, n, mm);
        small = min(a, (sum[h] + mm) / (n - h + 1));
      }
      if (small == a) cnt = n;
      big = small * cm + cnt * cf;
      if (big >= ans) {
        ans = big;
        ans_small = small;
        ans_cnt = cnt;
      }
    }
    for (int i = 1; i <= n; i++) {
      if (i <= ans_cnt) num[i].val = a;
      if (num[i].val < ans_small) num[i].val = ans_small;
    }
    sort(num + 1, num + n + 1, cmpw);
    ans = ans_cnt * cf + ans_small * cm;
    printf("%I64d\n", ans);
    printf("%d", num[1].val);
    for (int i = 2; i <= n; i++) printf(" %d", num[i].val);
    printf("\n");
  }
  return 0;
}
