#include <bits/stdc++.h>
using namespace std;
struct M {
  long long v;
  int id;
} a[1000002];
long long x[100002];
long long pre[100002];
long long back[100002];
bool cmp(M a, M b) { return a.v < b.v; }
bool check(long long tar, long long n, long long A, long long max_tar,
           long long m) {
  long long use = 0;
  int id;
  use = max_tar * A - back[max_tar];
  if (use > m) return 0;
  int lt = 1, rt = n - max_tar, mid;
  if (lt > rt) return 0;
  int idx = -1;
  int ans = -1;
  idx = (upper_bound(x + 1, x + rt + 1, tar) - x) - 1;
  if (use + tar * idx - pre[idx] <= m)
    return 1;
  else
    return 0;
}
bool cmp2(M a, M b) { return a.id < b.id; }
int main() {
  long long n, A, cf, cm, m, i;
  cin >> n >> A >> cf >> cm >> m;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i].v);
    a[i].id = i;
  }
  sort(a + 1, a + n + 1, cmp);
  for (i = 1; i <= n; i++) x[i] = a[i].v;
  memset(pre, 0, sizeof(pre));
  memset(back, 0, sizeof(back));
  pre[1] = a[1].v;
  back[1] = a[n].v;
  for (i = 2; i <= n; i++) pre[i] += pre[i - 1] + a[i].v;
  for (i = n - 1; i >= 1; --i) back[n - i + 1] += back[n - i] + a[i].v;
  long long tmpmax = 0, add_idx = -1;
  long long tmp_min = a[1].v, tmpnum = 0;
  for (i = 0; i <= n; ++i) {
    if (i * A - back[i] > m) break;
    long long lt = a[1].v, rt = A, mid;
    long long tar = -1, tmp;
    while (lt <= rt) {
      mid = (lt + rt) / 2;
      if (check(mid, n, A, i, m)) {
        tar = mid;
        lt = mid + 1;
      } else
        rt = mid - 1;
    }
    if (tar == -1) tar = A;
    if (tmpmax < tar * cm + i * cf) {
      tmp_min = tar;
      tmpnum = i;
      tmpmax = tar * cm + i * cf;
    }
  }
  for (i = 1; i <= n; ++i) {
    if (a[i].v < tmp_min)
      a[i].v = tmp_min;
    else
      break;
  }
  for (i = 0; i < tmpnum; ++i) {
    a[n - i].v = A;
  }
  sort(a + 1, a + n + 1, cmp2);
  cout << tmpmax << endl;
  for (i = 1; i <= n; i++) {
    if (i > 1) cout << " ";
    cout << a[i].v;
  }
  cout << endl;
  return 0;
}
