#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, x, y, i, j, l, pos1, pos2, A;
long long m, tmp1, tmp2, tmp3, ans;
struct node {
  int x, y;
} a[N];
int cmp1(const node& a, const node& b) { return a.x > b.x; }
int cmp2(const node& a, const node& b) { return a.y < b.y; }
int main() {
  scanf("%d%d%d%d%I64d", &n, &A, &x, &y, &m);
  for (i = 1; i <= n; i++) scanf("%d", &a[i].x), a[i].y = i;
  sort(a + 1, a + n + 1, cmp1);
  for (tmp1 = 0, i = 1; i <= n && tmp1 + A - a[i].x <= m; i++)
    tmp1 += A - a[i].x;
  ans = 0;
  j = n, tmp1 = m - tmp1 - A + a[i].x;
  for (i--; i >= 0; i--) {
    tmp1 = tmp1 + A - a[i + 1].x;
    while (j > i + 1) {
      tmp2 = (long long)(n - j + 1) * (a[j - 1].x - a[j].x);
      if (tmp1 < tmp2)
        break;
      else
        tmp1 -= tmp2, j--;
    }
    if (i < j)
      tmp3 = min(tmp1 / (n - j + 1) + a[j].x, (long long)A);
    else
      tmp3 = A;
    tmp2 = (long long)i * x + tmp3 * y;
    if (tmp2 >= ans) ans = tmp2, pos1 = i, pos2 = j, l = tmp3;
  }
  for (i = 1; i <= pos1; i++) a[i].x = A;
  for (i = pos2; i <= n; i++) a[i].x = l;
  sort(a + 1, a + n + 1, cmp2);
  for (printf("%I64d\n", ans), i = 1; i < n; i++) printf("%d ", a[i].x);
  return printf("%d\n", a[n].x), 0;
}
