#include <bits/stdc++.h>
using namespace std;
long long n, A, cf, cm, m;
long long a[100005];
long long pref[100005];
long long suff[100005];
map<int, int> cnt;
int b[100005];
map<int, int> wh;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 1; i <= n; i++) cin >> a[i], b[i] = a[i];
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) {
    wh[a[i]] = i;
    cnt[a[i]]++;
  }
  long long mn = 1e9;
  for (int i = 1; i <= n; i++) pref[i] = pref[i - 1] + a[i];
  for (int i = n; i >= 1; i--) suff[i] = suff[i + 1] + a[i], mn = min(mn, a[i]);
  long long ans = 0;
  long long cur = 0;
  pair<int, int> ans2 = make_pair(-1, -1);
  for (int i = 0; i <= n; i++) {
    long long tmp = m;
    long long how = (A * i) - suff[n - i + 1];
    if (how > m) continue;
    if (i) wh[a[n - i + 1]]--;
    tmp -= how;
    map<int, int>::iterator it;
    long long l = mn, h = A, mid, mxx = -1;
    while (l <= h) {
      mid = (l + h) >> 1;
      it = wh.lower_bound(mid);
      if (it == wh.begin()) {
        l = mid + 1;
        continue;
      }
      int where = (--it)->second;
      if (where >= n - i + 1) {
        where = n - i;
      }
      if (tmp - (mid * where - pref[where]) >= 0)
        l = mid + 1, mxx = mid;
      else
        h = mid - 1;
    }
    if (mxx == -1) {
      if (i == n)
        mxx = A;
      else
        mxx = mn;
    }
    long long cur = (i)*cf + mxx * cm;
    if (ans < cur) ans = cur, ans2 = make_pair(i, mxx);
  }
  cout << ans << "\n";
  map<int, int> xx;
  int j = ans2.first;
  for (int i = n; j > 0; i--, j--) {
    xx[a[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    if (xx[b[i]] > 0) {
      --xx[b[i]];
      b[i] = A;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (b[i] < ans2.second) b[i] = ans2.second;
  }
  for (int i = 1; i <= n; i++) cout << b[i] << " ";
  cout << "\n";
  return 0;
}
