#include <bits/stdc++.h>
using namespace std;
int n, A, cf, cm, ans[100005];
long long ss[100005];
pair<int, int> a[100005];
bool cmp(pair<int, int> x, pair<int, int> y) { return x.first > y.first; }
long long m;
bool check(long long s, int val, int pos) {
  int l = pos, r = n;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (a[mid].first < val)
      r = mid - 1;
    else
      l = mid + 1;
  }
  if (1ll * val * (n - l + 1) - (ss[n] - ss[l - 1]) <= s)
    return true;
  else
    return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  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, cmp);
  for (int i = 1; i <= n; ++i) ss[i] = ss[i - 1] + a[i].first;
  int l = 0, r = A;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (check(m, mid, 1) == true)
      l = mid + 1;
    else
      r = mid - 1;
  }
  long long rs = 1ll * r * cm;
  if (r == A) {
    rs = rs + 1ll * n * cf;
    cout << rs << '\n';
    for (int i = 1; i <= n; ++i) cout << A << " ";
    return 0;
  }
  int pre = 0, mi = r;
  long long sum = 0;
  for (int i = 1; i <= n - 1; ++i) {
    sum += (A - a[i].first);
    if (sum > m) break;
    int lf = 0, rt = A;
    while (lf <= rt) {
      int mid = (lf + rt) / 2;
      if (check(m - sum, mid, i + 1) == true)
        lf = mid + 1;
      else
        rt = mid - 1;
    }
    long long S = 1ll * rt * cm + 1ll * i * cf;
    if (S > rs) {
      rs = S;
      pre = i;
      mi = rt;
    }
  }
  cout << rs << '\n';
  for (int i = 1; i <= pre; ++i) ans[a[i].second] = A;
  for (int i = pre + 1; i <= n; ++i) {
    if (a[i].first >= mi)
      ans[a[i].second] = a[i].first;
    else
      ans[a[i].second] = mi;
  }
  for (int i = 1; i <= n; ++i) cout << ans[i] << " ";
}
