#include <bits/stdc++.h>
using namespace std;
struct data {
  int v, n;
} a[110001];
long long t, m, ans, a1, a2, s[110001], tmp;
int i, j, k, n, b[110001], c1, c2, lim;
int bs(int x, int n) {
  int l = 1, r = n, mid;
  if (!n || x <= a[1].v) return 0;
  while (l < r - 1) {
    mid = (l + r) >> 1;
    if (a[mid].v < x)
      l = mid;
    else
      r = mid - 1;
  }
  return (a[r].v < x) ? r : l;
}
bool check(long long x, int v, int n) {
  long long k;
  k = bs(v, n);
  return x >= k * (long long)v - s[k];
}
int work(long long x, int n) {
  int l = a[1].v, r = lim, mid;
  while (l < r - 1) {
    mid = (l + r) >> 1;
    if (check(x, mid, n))
      l = mid;
    else
      r = mid - 1;
  }
  return (check(x, r, n)) ? r : l;
}
bool cmp(data a, data b) { return a.v < b.v; }
int main() {
  scanf("%d%d%d%d%I64d", &n, &lim, &c1, &c2, &m);
  for (i = 1; i <= n; i++) scanf("%d", &a[i].v), a[i].n = i;
  sort(a + 1, a + 1 + n, cmp);
  for (s[0] = 0, i = 1; i <= n; i++) s[i] = s[i - 1] + a[i].v;
  for (ans = -1, i = t = 0; i <= n; i++) {
    if (t > m) break;
    k = work(m - t, n - i);
    tmp = (long long)k * (long long)c2 + (long long)i * (long long)c1;
    if (ans < tmp) ans = tmp, a1 = i, a2 = k;
    if (i < n) t += lim - a[n - i].v;
  }
  printf("%I64d\n", ans);
  for (i = 1; i <= n; i++) {
    b[a[i].n] = max(a2, (long long)a[i].v);
    if (i >= n - a1 + 1) b[a[i].n] = lim;
  }
  for (i = 1; i <= n; i++) printf("%d ", b[i]);
  puts("");
  return 0;
}
