#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
long long n, a, cf, cm, m;
long long arr[1000005];
long long brr[1000005];
long long srr[1000005];
int poss(long long val, long long lft, long long en) {
  auto z = lower_bound(arr + 1, arr + en + 1, val);
  long long pt = z - arr;
  pt--;
  long long exp = pt * val - (srr[pt]);
  if (exp <= lft) {
  }
  return (exp <= lft);
}
long long cal(long long x, int zz) {
  long long ans = cf * x;
  long long exp = x * a - (srr[n] - srr[n - x]);
  if (exp > m) return -1;
  if (exp <= m && x == n && zz == 1) return a;
  if (exp <= m && x == n) return (n * cf + a * cm);
  long long lft = m - exp;
  long long low = 0, mid, high = a;
  while (low != high) {
    mid = (low + high + 1) / 2;
    if (poss(mid, lft, n - x)) {
      low = mid;
    } else {
      high = mid - 1;
    }
  }
  if (zz == 1) return low;
  ans += cm * low;
  return ans;
}
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> a >> cf >> cm >> m;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    brr[i] = arr[i];
  }
  sort(arr + 1, arr + n + 1);
  srr[0] = 0;
  for (int i = 1; i <= n; i++) {
    srr[i] = srr[i - 1] + arr[i];
  }
  long long ans = 0;
  long long ii = 0;
  for (int i = 0; i <= n; i++) {
    long long tem = cal(i, 0);
    if (tem > ans) {
      ans = tem;
      ii = i;
    }
  }
  cout << ans << endl;
  int cm_val = cal(ii, 1);
  int cf_ct = ii;
  int ct = 0;
  for (int i = 1; i <= n; i++) {
    if (brr[i] >= arr[n - cf_ct + 1] && ct < ii) {
      brr[i] = a;
      ct++;
    }
    if (brr[i] < cm_val) brr[i] = cm_val;
  }
  for (int i = 1; i <= n; i++) {
    cout << brr[i] << " ";
  }
  cout << endl;
  return 0;
}
