#include <bits/stdc++.h>
using namespace std;
const long double Pi = 3.14159265359;
const long long MOD = 1000 * 1000 * 1000 + 7;
const long long MAXN = 2e5 + 10;
const long long INF = 1e18;
long long n, A, cf, cm, m;
long long par[MAXN];
pair<long long, long long> a[MAXN];
long long ans[MAXN];
long long a1[MAXN];
int main() {
  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);
  long long l = 0, r = 1e18;
  for (int i = 1; i <= n; i++) par[i] = par[i - 1] + a[i].first;
  long long Cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i].first == A) Cnt++;
  }
  long long sum = 0;
  long long Max = -INF;
  long long ans1, ans2;
  for (int i = 1; i <= n; i++) a1[i] = a[i].first;
  for (int i = Cnt; i <= n; i++) {
    sum = par[n] - par[n - i];
    if (i * A - sum > m) continue;
    sum = m - (i * A - sum);
    long long l1 = a[1].first, r1 = A + 1;
    while (r1 - l1 > 1) {
      long long mid = (r1 + l1) / 2;
      long long pnt = upper_bound(a1 + 1, a1 + 1 + n - i, mid) - a1 - 1;
      if (pnt * mid - par[pnt] <= sum)
        l1 = mid;
      else
        r1 = mid;
    }
    if (Max < cf * i + (cm * l1)) {
      ans1 = i, ans2 = l1;
    }
    Max = max(Max, cf * i + (cm * l1));
  }
  cout << Max << '\n';
  for (int i = 1; i <= n - ans1; i++) {
    ans[a[i].second] = max(ans2, a[i].first);
  }
  for (int i = n - ans1 + 1; i <= n; i++) ans[a[i].second] = A;
  for (int i = 1; i <= n; i++) cout << ans[i] << ' ';
  return 0;
}
