#include <bits/stdc++.h>
using namespace std;
long long int n, m, a[100007], cf, cm, mm, d[100007], ans = 0, now;
vector<vector<long long int> > v;
vector<long long int> ok(2);
pair<long long int, long long int> ans1;
long long int find(long long int l, long long int r) {
  if (r < l) return 0;
  long long int ans = d[r];
  if (l != 0) ans -= d[l - 1];
  return ans;
}
long long int bin(long long int lef, long long int rr) {
  long long int i, j, l, r, m, ans = -1;
  now = n;
  r = n - 1;
  l = rr;
  while (r - l > 1) {
    m = (l + r) / 2;
    if (v[m][0] * (n - 1 - m + 1) - find(m, n - 1) <= lef) {
      r = m;
    } else {
      l = m;
    }
  }
  ans = (rr + 1) * cf;
  if (v[r][0] * (n - 1 - r + 1) - find(r, n - 1) <= lef) {
    lef -= v[r][0] * (n - 1 - r + 1) - find(r, n - 1);
    long long int k = lef / (n - 1 - r + 1);
    ans += min(mm, v[r][0] + k) * cm;
    if (min(mm, v[r][0] + k) == mm) {
      ans = n * cf + mm * cm;
    }
    now = r;
  }
  return ans;
}
void solve() {
  int i, j, l, r;
  scanf("%I64d%I64d%I64d%I64d%I64d", &n, &mm, &cf, &cm, &m);
  ans1.first = -1;
  ans1.second = n;
  for (i = 0; i < n; i++) {
    scanf("%I64d", &a[i]);
    ok[0] = a[i];
    ok[1] = i;
    v.push_back(ok);
  }
  sort(v.rbegin(), v.rend());
  d[0] = v[0][0];
  for (i = 1; i < n; i++) {
    d[i] = d[i - 1] + v[i][0];
  }
  for (r = -1; r < n; r++) {
    long long int left;
    now = n;
    left = mm * (r + 1) - find(0, r);
    left = m - left;
    if (left >= 0) {
      long long int k = bin(left, r);
      if (k > ans) {
        ans = k;
        ans1.first = r;
        ans1.second = now;
      }
    }
  }
  for (i = 0; i <= ans1.first; i++) {
    m -= mm - v[i][0];
    v[i][0] = mm;
  }
  if (ans1.first == -1 && ans1.second == n) {
    printf("%I64d\n", ans);
    for (i = 0; i < n; i++) {
      printf("%I64d ", a[i]);
    }
    return;
  }
  for (i = ans1.second; i < n; i++) {
    m -= v[ans1.second][0] - v[i][0];
    v[i][0] = v[ans1.second][0];
  }
  long long int k;
  if (ans1.second != n) k = m / (n - 1 - ans1.second + 1);
  for (i = ans1.second; i < n; i++) {
    m -= min(mm, v[i][0] + k) - v[i][0];
    v[i][0] = min(mm, v[i][0] + k);
  }
  long long int mmm = 1e17, mms = 0;
  for (i = 0; i < n; i++) {
    a[v[i][1]] = v[i][0];
  }
  for (i = 0; i < n; i++) {
    if (a[i] < mm) {
      long long int tt = min(mm, a[i] + m);
      m -= tt - a[i];
      a[i] = tt;
    }
    if (a[i] == mm) mms++;
    mmm = min(mmm, a[i]);
  }
  ans = cf * mms + cm * mmm;
  printf("%I64d\n", ans);
  for (i = 0; i < n; i++) {
    printf("%I64d ", a[i]);
  }
  i = 1;
}
int main() {
#pragma comment(linker, "/STACK:268435456")
  solve();
  return 0;
}
