#include <bits/stdc++.h>
using namespace std;
int n, cf, cm;
int a[100010], b[100010], id[100010];
long long A, m, sum[100010];
inline bool cmp(const int& x, const int& y) {
  if (a[x] == a[y]) return x < y;
  return a[x] < a[y];
}
long long check(long long h, int i) {
  if (h > b[i]) return h * i - sum[i];
  int pos = lower_bound(b + 1, b + i + 1, h) - b;
  if (b[pos] == h) {
    return h * pos - sum[pos];
  } else {
    if (pos == 1) {
      return 0;
    } else {
      return h * (pos - 1) - sum[pos - 1];
    }
  }
}
int main() {
  scanf("%d%I64d%d%d%I64d", &n, &A, &cf, &cm, &m);
  sum[0] = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    b[i] = a[i];
    id[i] = i;
  }
  sort(id + 1, id + n + 1, cmp);
  sort(b + 1, b + n + 1);
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + a[id[i]];
  }
  long long ans = -1;
  int ht = 0, cr = 0;
  if (m - (n * A - sum[n]) >= 0) {
    ans = n * cf + A * cm;
    printf("%I64d\n", ans);
    for (int i = 1; i <= n; i++) printf("%d ", A);
    printf("\n");
    return 0;
  }
  for (int i = n + 1; i >= 2; --i) {
    long long cnt = (n - i + 1) * cf;
    long long res = m - ((n - i + 1) * A - (sum[n] - sum[i - 1]));
    if (b[i - 1] == A) continue;
    if (res < 0) break;
    int l = b[1], r = A;
    while (l < r) {
      int mid = (l + r) >> 1;
      long long num = check(mid, i - 1);
      if (num <= res)
        l = mid + 1;
      else
        r = mid - 1;
    }
    while (l >= b[1] && check(l, i - 1) > res) --l;
    cnt += (long long)l * cm;
    if (cnt > ans) {
      ans = cnt;
      ht = l, cr = i;
    }
  }
  printf("%I64d\n", ans);
  for (int i = 1; i <= n; ++i) {
    if (a[id[i]] <= ht) a[id[i]] = ht;
    if (i >= cr) a[id[i]] = A;
  }
  for (int i = 1; i <= n; ++i) printf("%d ", a[i]);
  printf("\n");
  return 0;
}
