#include <bits/stdc++.h>
using namespace std;
long long oo = (long long)1e9 + 7;
int n, cf, cm;
long long A, m;
pair<long long, int> all[200008];
long long lift[200008], full[200008];
long long ans = 0, maxx, minn;
void input() {
  scanf("%d", &n);
  scanf("%lld", &A);
  scanf("%d%d", &cf, &cm);
  scanf("%lld", &m);
  for (int i = 0; i < n; i++) {
    all[i].second = i;
    scanf("%lld", &all[i].first);
  }
}
void prep() {
  sort(all, all + n);
  memset(lift, 0, sizeof lift);
  memset(full, 0, sizeof full);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    long long val = all[i].first;
    sum += val;
    lift[i] = (i + 1) * val - sum;
  }
  for (int i = n - 1; i >= 0; i--) full[i] = full[i + 1] + A - all[i].first;
}
long long prnt[200008];
void solve() {
  for (int i = 0; i < n; i++) {
    if (full[n - i] > m) break;
    long long rem = m - full[n - i];
    int pos = upper_bound(lift, lift + n - i, rem) - lift;
    pos--;
    rem -= lift[pos];
    long long give = rem / (pos + 1);
    long long cur = i * cf;
    long long fuckmin = min(A, all[pos].first + give);
    cur += cm * fuckmin;
    if (cur > ans) {
      ans = cur;
      maxx = i;
      minn = fuckmin;
    }
  }
  if (full[0] <= m) {
    ans = A * cm + (long long)n * (long long)cf;
    maxx = n;
    minn = A;
  }
  printf("%lld\n", ans);
  for (int i = 0; i < n; i++) all[i].first = max(all[i].first, minn);
  while (maxx--) all[n - 1 - maxx].first = A;
  for (int i = 0; i < n; i++) prnt[all[i].second] = all[i].first;
  for (int i = 0; i < n; i++) printf("%lld ", prnt[i]);
}
int main() {
  input();
  prep();
  solve();
}
