#include <bits/stdc++.h>
using std::abs;
using std::bitset;
using std::cerr;
using std::cin;
using std::cout;
using std::deque;
using std::map;
using std::max;
using std::min;
using std::pair;
using std::queue;
using std::set;
using std::sort;
using std::string;
using std::swap;
using std::unordered_map;
using std::unordered_set;
using std::vector;
void init() {
  std::iostream::sync_with_stdio(0);
  cout << std::fixed;
  cout.precision(10);
  cerr << std::fixed;
  cerr.precision(10);
  srand(std::chrono::duration_cast<std::chrono::nanoseconds>(
            std::chrono::high_resolution_clock::now().time_since_epoch())
            .count());
}
const int MAXN = 1e5 + 1;
pair<long long, long long> arr[MAXN];
long long suf[MAXN];
int main() {
  init();
  long long n, maxa, full, worst, m;
  cin >> n >> maxa >> full >> worst >> m;
  for (int i = 0; i < n; ++i) {
    long long x;
    cin >> x;
    arr[i] = {x, i};
  }
  sort(arr, arr + n);
  std::reverse(arr, arr + n);
  suf[n] = 0;
  for (int i = n - 1; i >= 0; --i) suf[i] = suf[i + 1] + arr[i].first;
  long long pref = 0;
  long long ans = 0;
  long long cntfull = 0, wv = 0;
  int pos = 0;
  for (int i = 0; i < n; ++i) {
    long long curm = m - pref;
    if (curm < 0) break;
    pos = max(pos, i);
    long long need = (n - pos) * arr[pos].first - suf[pos];
    while (curm - need < 0) {
      ++pos;
      need = (n - pos) * arr[pos].first - suf[pos];
      if (pos == n) break;
    }
    if (pos == n) break;
    long long free_money = curm - need;
    long long worst_val = min(arr[pos].first + (free_money / (n - pos)), maxa);
    long long attempt = full * i + worst * worst_val;
    if (ans < attempt) {
      ans = attempt;
      cntfull = i;
      wv = worst_val;
    }
    pref += (maxa - arr[i].first);
  }
  if (m >= maxa * n - suf[0]) {
    if (full * n + worst * maxa > ans) {
      ans = full * n + worst * maxa;
      cntfull = n;
      wv = maxa;
    }
  }
  for (int i = 0; i < cntfull; ++i) arr[i].first = maxa;
  for (int i = 0; i < n; ++i) arr[i].first = max(arr[i].first, wv);
  for (int i = 0; i < n; ++i) swap(arr[i].first, arr[i].second);
  sort(arr, arr + n);
  cout << ans << '\n';
  for (int i = 0; i < n; ++i) cout << arr[i].second << ' ';
  cout << '\n';
  return 0;
}
