#include <bits/stdc++.h>
using namespace std;
long long a[100010], b[100010], c, d, e, f[100010], g[100010];
int h;
long long i;
int find(long long* a, long long j) {
  int k = 1, l = h, m = 0;
  while (k <= l) {
    int i = (k + l) / 2;
    if (a[i] == j) return i;
    if (a[i] < j)
      l = i - 1;
    else
      k = i + 1, m = i;
  }
  return m;
}
long long n(long long j) {
  long long o = 0;
  for (int p = 1; p <= h && a[p] < j; p++) o += j - a[p];
  if (o > i) return -(1ll << 60);
  long long q = 0, r = j;
  for (int p = 1; p <= h; p++) {
    long long s = (b[p] < e - j ? b[p] : e - j);
    if (o + s > i) break;
    o += s;
    q++;
  }
  return q * c + j * d;
}
int t[100000 + 10];
bool u(int j, int v) { return a[j] < a[v]; }
bool w(int j, int v) { return t[j] < t[v]; }
int main() {
  scanf("%d%I64d%I64d%I64d%I64d", &h, &e, &c, &d, &i);
  for (int p = 1; p <= h; p++) scanf("%I64d", &a[p]), t[p] = p;
  sort(t + 1, t + h + 1, u);
  sort(a + 1, a + h + 1);
  for (int p = 1; p <= h; p++) b[h - p + 1] = e - a[p];
  for (int p = 1; p <= h; p++) f[p] = f[p - 1] + a[p], g[p] = g[p - 1] + b[p];
  long long k = a[1], l = e, x = a[1], y = 0;
  while (k <= l) {
    long long z = k + (l - k) / 3, A = l - (l - k) / 3;
    long long B = n(z), C = n(A);
    if (B < C) {
      if (C > y) {
        y = C;
        x = A;
      }
      k = z + 1;
    } else {
      if (B > y) {
        y = B;
        x = z;
      }
      l = A - 1;
    }
  }
  for (int p = 1; p <= h && a[p] < x; p++) i -= x - a[p], a[p] = x;
  for (int p = h; p; p--)
    if (i >= e - a[p]) i -= e - a[p], a[p] = e;
  cout << y << endl;
  for (int p = 1; p <= h; p++) b[t[p]] = a[p];
  for (int p = 1; p <= h; p++) printf("%I64d\n", b[p]);
  return 0;
}
