#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<pair<long long, int> > v;
long long n, a, cf, cm, m, com[N], org[N];
long long ch(long long val, int z) {
  long long lo = 0, hi = v.size() - 1 - z, mid;
  if (z == v.size()) return 0;
  while (lo < hi) {
    mid = lo + (hi - lo + 1) / 2;
    if (v[mid].first <= val)
      lo = mid;
    else
      hi = mid - 1;
  }
  if (v[lo].first > val) return 0;
  lo++;
  return val * lo - com[lo];
}
int main() {
  cin >> n >> a >> cf >> cm >> m;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    v.push_back({x, i});
    org[i] = x;
  }
  sort(v.begin(), v.end());
  for (int i = 1; i <= n; i++) {
    int x = v[i - 1].first;
    com[i] = com[i - 1] + x;
  }
  long long ans = -1, A, B;
  for (int i = 0; i <= n; i++) {
    long long c = i * a - (com[n] - com[n - i]);
    c = m - c;
    if (c < 0) break;
    long long lo = 0, hi = a, mid;
    while (lo < hi) {
      mid = lo + (hi - lo + 1) / 2;
      if (ch(mid, i) <= c)
        lo = mid;
      else
        hi = mid - 1;
    }
    if (i * cf + cm * lo > ans) {
      ans = i * cf + lo * cm;
      A = i;
      B = lo;
    }
  }
  cout << ans << endl;
  for (int i = 1; i <= n; i++) org[i] = max(org[i], B);
  reverse(v.begin(), v.end());
  for (int i = 0; i < A; i++) {
    org[v[i].second] = a;
  }
  for (int i = 1; i <= n; i++) cout << org[i] << ' ';
  return 0;
}
