#include <bits/stdc++.h>
using namespace std;
struct dot {
  int v, x;
  dot() { v = x = 0; }
} p[100005];
long long sum[100005];
bool cmp1(dot a, dot b) { return a.v < b.v; }
bool cmp2(dot a, dot b) { return a.x < b.x; }
int main() {
  int n, a, cf, cm;
  long long m, ans = -1, maxn = 0, minn = 0, minv = 0;
  scanf("%d %d %d %d %lld", &n, &a, &cf, &cm, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &p[i].v);
    p[i].x = i;
  }
  sort(p, p + n, cmp1);
  sum[0] = 0;
  for (int i = 0; i < n; ++i) {
    sum[i + 1] = sum[i] + p[i].v;
  }
  long long money = 0;
  int j = 0, i;
  long long tans = 0, tmin = 0, exceed;
  for (i = 0, j = 0; i <= n; i++) {
    money = (long long)a * (n - i) - (sum[n] - sum[i]);
    if (money > m) continue;
    tans = (n - i) * cf;
    exceed = m - money;
    while (j < i && (long long)p[j].v * j - sum[j] <= exceed) {
      ++j;
    }
    if (!j) {
      tmin = a;
    } else {
      tmin = min((exceed + sum[j]) / j, (long long)a);
    }
    tans += (long long)tmin * cm;
    if (ans < tans) {
      ans = tans;
      maxn = i;
      minn = j - 1;
      minv = tmin;
    }
  }
  for (i = maxn; i < n; i++) {
    p[i].v = a;
  }
  for (i = 0; i <= minn; i++) {
    p[i].v = minv;
  }
  sort(p, p + n, cmp2);
  printf("%lld\n", ans);
  for (i = 0; i < n; i++) {
    printf("%d ", p[i].v);
  }
  puts("");
  return 0;
}
