#include <bits/stdc++.h>
using namespace std;
long long n, a, cf, cm, m, psum[100010]{}, msum[100010]{};
pair<long long, int> x[100010];
bool cid(pair<long long, int> a, pair<long long, int> b) {
  return a.second < b.second;
}
int main() {
  scanf("%I64d%I64d%I64d%I64d%I64d", &n, &a, &cf, &cm, &m);
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    x[i] = {a, i};
  }
  sort(x, x + n);
  psum[0] = 0;
  for (int i = 1; i < n; i++)
    psum[i] = psum[i - 1] + (x[i].first - x[i - 1].first) * i;
  for (int i = n - 1; i >= 0; i--) msum[i] = msum[i + 1] + a - x[i].first;
  long long cmax = -1, maxv, minv;
  for (int i = n, j = n - 1; i >= 0; i--) {
    while (j >= 0 && msum[i] + psum[j] > m) j--;
    if (j < 0) break;
    if (j >= i) {
      if (i == 0) {
        cmax = n * cf + a * cm;
        maxv = i;
        minv = cm;
      } else {
        j = i - 1;
        long long val =
            cf * (n - i) +
            cm * (min(a, x[j].first + (m - msum[i] - psum[j]) / (j + 1)));
        if (val > cmax) {
          cmax = val;
          maxv = i;
          minv = min(a, x[j].first + (m - msum[i] - psum[j]) / (j + 1));
        }
      }
    } else {
      long long val =
          cf * (n - i) +
          cm * (min(a, x[j].first + (m - msum[i] - psum[j]) / (j + 1)));
      if (val > cmax) {
        cmax = val;
        maxv = i;
        minv = min(a, x[j].first + (m - msum[i] - psum[j]) / (j + 1));
      }
    }
  }
  for (int i = n - 1; i >= maxv; i--) x[i].first = a;
  for (int i = 0; i < maxv; i++) x[i].first = max(x[i].first, minv);
  sort(x, x + n, cid);
  printf("%I64d\n", cmax);
  for (int i = 0; i < n; i++) printf("%I64d ", x[i].first);
  return 0;
}
