#include <bits/stdc++.h>
using namespace std;
const long long int oo = 1e18;
const long long int MOD = 1e9 + 7;
const long long int maxN = 1e6 + 5;
long long int pre[maxN], A, cm, cf, m, n, ans, b[maxN], tmp;
pair<long long int, long long int> a[maxN];
struct super {
  long long int min1, num;
};
super save;
long long int tinh(long long int money) {
  long long int l = 1;
  long long int r = n + 1;
  long long int ans = 0;
  while (l <= r) {
    long long int mid = (l + r) / 2;
    if (A * (n - mid + 1) - (pre[n] - pre[mid - 1]) <= money) {
      ans = n - mid + 1;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  return ans;
}
void solve() {
  cin >> n >> A >> cf >> cm >> m;
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  if (cf == 0 && cm == 0) {
    cout << 0 << endl;
    for (long long int i = 1; i <= n; i++) cout << a[i].first << " ";
    return;
  }
  sort(a + 1, a + 1 + n);
  for (long long int i = 1; i <= n; i++) pre[i] = pre[i - 1] + a[i].first;
  for (long long int num = 0; num <= n; num++) {
    long long int val = A * num - (pre[n] - pre[n - num]);
    if (num == 0) val = 0;
    long long int m1 = m - val;
    if (m1 < 0) continue;
    long long int l = 0;
    long long int r = n - num;
    long long int tmp = num * cf;
    long long int pos = 0, min1 = 0;
    while (l <= r) {
      long long int mid = (l + r) / 2;
      if (a[mid].first * mid - pre[mid] <= m1) {
        pos = mid;
        min1 = a[mid].first;
        l = mid + 1;
      } else
        r = mid - 1;
    }
    if (pos > 0) {
      min1 += (m1 - (a[pos].first * pos - pre[pos])) / pos;
      min1 = min(A, min1);
      if (min1 == A) tmp = n * cf;
    }
    tmp += min1 * cm;
    if (ans < tmp) {
      save.num = num;
      save.min1 = min1;
      ans = tmp;
    }
  }
  cout << ans << endl;
  for (long long int i = n; i >= n - save.num + 1; i--) {
    if (a[i].first < A) a[i].first = A;
    b[a[i].second] = a[i].first;
  }
  for (long long int i = 1; i <= n; i++) {
    if (a[i].first < save.min1) a[i].first = save.min1;
    b[a[i].second] = a[i].first;
  }
  for (long long int i = 1; i <= n; i++) cout << b[i] << " ";
  return;
}
int main() {
  {
    ios::sync_with_stdio(false);
    cin.tie(0);
  };
  int t = 1;
  while (t--) solve();
  return 0;
}
