#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
int n, A, cf, cm;
long long m;
pair<int, int> a[N];
long long b[N], upto[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a, a + n);
  reverse(a, a + n);
  b[0] = A - a[0].first;
  for (int i = 1; i < n; ++i) {
    b[i] = b[i - 1] + A - a[i].first;
  }
  reverse(a, a + n);
  upto[0] = 0;
  for (int i = 1; i < n; ++i) {
    upto[i] = upto[i - 1] + 1LL * i * (a[i].first - a[i - 1].first);
  }
  long long score = -1;
  int mxcnt, minval;
  for (int mx = 0; mx <= n; ++mx) {
    long long req = (mx ? b[mx - 1] : 0);
    if (m - req < 0) {
      break;
    }
    if (mx == n) {
      if (1LL * mx * cf + 1LL * A * cm > score) {
        score = 1LL * mx * cf + 1LL * A * cm;
        mxcnt = mx, minval = A;
      }
      break;
    }
    long long rem = m - req;
    int idx = upper_bound(upto, upto + n - mx, rem) - upto;
    idx--;
    long long tminval = a[idx].first;
    rem -= upto[idx];
    long long grow = rem / (idx + 1);
    tminval += grow;
    tminval = min(tminval, (long long)A);
    if (1LL * mx * cf + 1LL * tminval * cm > score) {
      score = 1LL * mx * cf + 1LL * tminval * cm;
      mxcnt = mx, minval = tminval;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (a[i].first < minval) a[i].first = minval;
  }
  for (int i = 0; i < mxcnt; ++i) {
    a[n - i - 1].first = A;
  }
  cout << score << "\n";
  sort(a, a + n,
       [](const pair<int, int> &p1, const pair<int, int> &p2) -> bool {
         return p1.second < p2.second;
       });
  for (int i = 0; i < n; ++i) {
    cout << a[i].first << " ";
  }
  cout << "\n";
  return 0;
}
