#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> a[100069], b[100069];
long long k, cost, n, per, mi, ma, cf, cm, m, re[100069], Max[100069],
    Min[100069], ans;
long long check(long long cost, int pos) {
  long long f, l, mmid, mid, anspos, ans = 0, f1 = 1, l1 = per;
  while (f1 <= l1) {
    mmid = (f1 + l1) / 2;
    f = 1;
    l = pos;
    anspos = 0;
    while (f <= l) {
      mid = (f + l) / 2;
      if (a[mid].first <= mmid)
        anspos = mid, f = mid + 1;
      else {
        l = mid - 1;
      }
    }
    if (anspos * mmid - Min[anspos] <= cost) {
      ans = max(ans, mmid);
      f1 = mmid + 1;
    } else
      l1 = mmid - 1;
  }
  return ans;
}
int main() {
  scanf("%lld%lld%lld%lld%lld", &n, &per, &cf, &cm, &m);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &a[i].first);
    a[i].second = i;
    b[i].first = a[i].first;
    b[i].second = a[i].second;
  }
  sort(a + 1, a + 1 + n);
  sort(b + 1, b + 1 + n);
  for (long long i = n; i >= 1; i--) {
    Max[i] = Max[i + 1] + (per - a[i].first);
  }
  for (long long i = 1; i <= n; i++) {
    Min[i] = Min[i - 1] + a[i].first;
  }
  mi = 0;
  ma = n + 1;
  for (long long i = n + 1; i >= 1; i--) {
    a[i].first = per;
    Min[i] = Min[i - 1] + a[i].first;
    if (Max[i] <= m) {
      cost = m - Max[i];
      k = check(cost, i - 1);
      if (ans < (n - i + 1) * cf + k * cm) {
        ans = (n - i + 1) * cf + k * cm;
        mi = k;
        ma = i;
      }
    } else
      break;
  }
  cout << ans << endl;
  for (int i = ma; i <= n; i++) {
    b[i].first = per;
  }
  for (int i = 1; i <= n; i++) {
    if (b[i].first <= mi)
      b[i].first = mi;
    else
      break;
  }
  for (int i = 1; i <= n; i++) re[b[i].second] = b[i].first;
  for (long long i = 1; i <= n; i++) printf("%lld ", re[i]);
}
