#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:128000000")
using namespace std;
mt19937 ggen;
int n;
long long A, cf, cm, m;
pair<long long, int> a[100010];
long long aval[100010];
long long ps[100010];
long long rps[100010];
long long mps[100010];
void solve() {
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    ps[i] = ps[i - 1] + a[i].first;
  }
  mps[0] = mps[1] = 0;
  for (int i = 2; i <= n; i++) {
    mps[i] = mps[i - 1] +
             (long long)(i - 1) * (long long)(a[i].first - a[i - 1].first);
  }
  for (int i = n; i >= 1; i--) rps[n - i + 1] = rps[n - i] + a[i].first;
  long long ansv = -1, anspref, anspval, anssuff;
  for (int i = 0; i <= n; i++) {
    long long needA = (long long)(i)*A - rps[i];
    if (needA > m) break;
    long long ost = m - needA;
    int l = 0, r = n - i, mid, res = -1;
    while (l <= r) {
      mid = (l + r) >> 1;
      if (mps[mid] <= ost) {
        res = mid;
        l = mid + 1;
      } else
        r = mid - 1;
    }
    if (res == -1) continue;
    ost -= mps[res];
    long long tans = cf * (long long)(i);
    long long minl;
    if (res == 0)
      minl = A;
    else
      minl = a[res].first + min(ost / (long long)(res), A - a[res].first);
    tans += minl * cm;
    if (ansv == -1 || tans > ansv) {
      anspref = res;
      anssuff = i;
      anspval = minl;
      ansv = tans;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (n - i < anssuff) {
      aval[a[i].second] = A;
    } else if (i <= anspref) {
      aval[a[i].second] = anspval;
    } else
      aval[a[i].second] = a[i].first;
  }
  cout << ansv << endl;
  for (int i = 1; i <= n; i++) cout << aval[i] << " ";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  srand(88);
  ggen = mt19937(88);
  solve();
  return 0;
}
