#include <bits/stdc++.h>
const bool DEBUG = false;
using namespace std;
const long long maxn = 2e5 + 5;
const long long INF = 1e18 + 1;
const int lg = 21;
long long n, A, cf, l, cm, m, mn, M, perfect, ans, nowm, pre[maxn], dp[maxn],
    b[maxn];
pair<long long, long long> a[maxn];
bool check(long long mn, long long m, long long i) {
  long long ind = upper_bound(a, a + i, make_pair(mn, n)) - a;
  if (ind == 0) return 1;
  long long sum = pre[ind - 1];
  if (mn * ind - sum <= m) return 1;
  return 0;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  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);
  dp[n - 1] = a[n - 1].first;
  for (int i = n - 2; i >= 0; i--) dp[i] = dp[i + 1] + a[i].first;
  pre[0] = a[0].first;
  for (int i = 1; i < n; i++) pre[i] = pre[i - 1] + a[i].first;
  for (int i = n; i >= 0; i--) {
    m = M - (l * A - dp[i]);
    if (m < 0) break;
    int low = 0, high = A + 1, mid = 0;
    while (high - low > 1) {
      mid = high + low >> 1;
      if (check(mid, m, i))
        low = mid;
      else
        high = mid;
    }
    long long ANS = l * cf + low * cm;
    if (ANS > ans) {
      ans = ANS;
      mn = low;
      perfect = l;
    }
    l++;
  }
  for (int i = n - 1; i >= n - perfect; i--) b[a[i].second] = A;
  cout << ans << endl;
  for (int i = n - perfect - 1; i >= 0; i--)
    if (a[i].first < mn)
      b[a[i].second] = mn;
    else
      b[a[i].second] = a[i].first;
  for (int i = 0; i < n; i++) cout << b[i] << " ";
  return 0;
}
