#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, f, cf, cm, t, a[N];
long long m, ans, s[N];
int ans_val, ans_f;
pair<int, int> b[N];
bool change[N];
long long calc(int val) {
  int l, r, mid, pos;
  pos = 0;
  l = 1;
  r = t;
  while (l <= r) {
    mid = (l + r) / 2;
    if (b[mid].first <= val)
      pos = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  return 1ll * val * pos - s[pos];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> f >> cf >> cm >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    b[i] = make_pair(a[i], i);
  }
  ans = 0;
  t = n;
  sort(b + 1, b + n + 1);
  for (int i = 1; i <= n; ++i) s[i] = s[i - 1] + b[i].first;
  for (int i = 0; i <= n; ++i) {
    int l, r, mid, tmp;
    tmp = l = 0;
    r = f;
    while (l <= r) {
      mid = (l + r) >> 1;
      if (calc(mid) <= m)
        tmp = mid, l = mid + 1;
      else
        r = mid - 1;
    }
    long long tmp_ans = 1ll * i * cf + 1ll * tmp * cm;
    if (tmp_ans >= ans) {
      ans = tmp_ans;
      ans_val = i;
      ans_f = tmp;
    }
    m -= (f - b[t].first);
    --t;
    if (m < 0) break;
  }
  cout << ans << endl;
  for (int i = n; i >= n - ans_val + 1; --i) change[b[i].second] = 1;
  for (int i = 1; i <= n; ++i) {
    if (change[i])
      a[i] = f;
    else {
      if (a[i] < ans_f) a[i] = ans_f;
    }
  }
  for (int i = 1; i <= n; ++i) cout << a[i] << (i == n ? '\n' : ' ');
  return 0;
}
