#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const double eps = 1e-6;
const long long INF = 1e18;
struct Node {
  long long x, id;
  bool operator<(const Node &z) const { return x < z.x; }
} a[maxn];
long long n, bound, cf, cm, m;
long long b[maxn], s[maxn];
bool cmp(const Node &a, const Node &b) { return a.id < b.id; }
long long sol(long long x, long long &c) {
  long long l, r, mid, pos;
  l = a[1].x;
  r = bound;
  if (x == n) {
    c = bound;
    return bound * cm + n * cf;
  }
  while (r - l > 1) {
    mid = (l + r) >> 1;
    pos = lower_bound(a + 1, a + n - x + 1, Node{mid, 0}) - a - 1;
    if (pos * mid - s[pos] <= m - b[x])
      l = mid;
    else
      r = mid;
  }
  c = l;
  return l * cm + x * cf;
}
int main() {
  long long i, j, cnt;
  scanf("%I64d%I64d%I64d%I64d%I64d", &n, &bound, &cf, &cm, &m);
  for (i = 1; i <= n; i++) {
    scanf("%I64d", &a[i].x);
    a[i].id = i;
  }
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) s[i] = s[i - 1] + a[i].x;
  cnt = 0;
  for (i = n, b[0] = j = 0; i >= 1; i--) {
    if (j + bound - a[i].x <= m) {
      j += bound - a[i].x;
      b[++cnt] = j;
    }
  }
  long long c;
  long long mid1, mid2, l = 0, r = cnt;
  while (r - l > 2) {
    mid1 = l + (r - l) / 3;
    mid2 = l + 2 * (r - l) / 3;
    if (sol(mid1, c) >= sol(mid2, c))
      r = mid2;
    else
      l = mid1;
  }
  long long c1, c2, tmp, ans = -INF;
  for (i = l; i <= r; i++) {
    tmp = sol(i, c);
    if (ans < tmp) {
      c1 = i;
      c2 = c;
      ans = tmp;
    }
  }
  for (i = n; i > n - c1; i--) a[i].x = bound;
  for (i = 1; i <= n; i++) {
    if (a[i].x < c2) a[i].x = c2;
  }
  sort(a + 1, a + n + 1, cmp);
  printf("%I64d\n", ans);
  for (i = 1; i <= n; i++) {
    if (i - 1) putchar(' ');
    printf("%I64d", a[i].x);
  }
  putchar('\n');
  return 0;
}
