#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, A, x, y, a[N];
long long with, cum[N], need[N];
vector<int> v, sol;
vector<pair<int, int> > p;
pair<int, int> BS(long long with) {
  int l = v[1] + 1, r = A, res = v[1], pos = 1;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    int k = lower_bound(v.begin(), v.end(), mid) - v.begin();
    if (k == (int)v.size() || v[k] >= mid) --k;
    if (need[k] - (1LL * k * (A - mid)) <= with) {
      res = mid;
      l = mid + 1;
      pos = k;
    } else
      r = mid - 1;
  }
  if (res != A) pos = 0;
  return make_pair(res, pos);
}
void path(int full, int mn) {
  sol.resize(n);
  for (int i = 1; i <= n; ++i) p.push_back(make_pair(a[i], i - 1));
  sort(p.begin(), p.end());
  for (int i = 0; i < full; ++i) {
    sol[p.back().second] = A;
    p.pop_back();
  }
  for (size_t i = 0; i < p.size(); ++i) sol[p[i].second] = max(p[i].first, mn);
}
int main() {
  scanf("%d%d%d%d%lld", &n, &A, &x, &y, &with);
  int full = 0;
  v.push_back(-1);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    v.push_back(a[i]);
    if (a[i] == A) ++full;
  }
  sort(v.begin(), v.end());
  for (int i = 1; i <= n; ++i) {
    cum[i] = cum[i - 1] + v[i];
    need[i] = need[i - 1] + (A - v[i]);
  }
  if (need[n] <= with) {
    long long res = 0;
    res += 1LL * x * n;
    res += 1LL * y * A;
    printf("%lld\n", res);
    for (int i = 0; i < n; ++i) printf("%s%d", i ? " " : "", A);
    puts("");
    return 0;
  }
  long long best = -1, at = -1, all = 0;
  int small, can = 0;
  bool stop = false;
  for (int i = 0; i < n; ++i) {
    if (i) {
      int d = A - v.back();
      if (all + d > with) {
        stop = true;
      } else {
        all += d;
        v.pop_back();
        can = i;
      }
    }
    pair<int, int> b = BS(with - all);
    long long res = 0;
    res += 1LL * x * (max(can, full) + b.second);
    res += 1LL * y * b.first;
    if (res > best) {
      best = res;
      at = max(full, i) + b.second;
      small = b.first;
    }
    if (stop) break;
  }
  printf("%lld\n", best);
  path(at, small);
  for (int i = 0; i < n; ++i) printf("%s%d", i ? " " : "", sol[i]);
  puts("");
  return 0;
}
