#include <bits/stdc++.h>
using namespace std;
inline vector<string> __split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
inline void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
inline void err(vector<string>::iterator it, T a, Args... args) {
  auto item = it->substr((*it)[0] == ' ', it->length());
  cerr << item << ": " << a << '\n';
  err(++it, args...);
}
static char buff[(int)1e6 + 17];
static constexpr long long inf = (long long)1e9 + 7ll;
inline void config_io(const bool& __fastio) {
  if (__fastio) {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
  }
  if (!std::string("").empty()) {
    assert(
        freopen(""
                ".in",
                "r", stdin));
    assert(
        freopen(""
                ".out",
                "w", stdout));
  }
}
const int maxn = (int)1e5 + 17;
int n;
long long mx, cf, cm, m;
pair<long long, int> a[maxn];
long long sum[maxn], arr[maxn];
long long solve(int j, bool ret_l = false) {
  long long cnt =
      1ll * mx * j - sum[n - 1] + (n - 1 - j >= 0 ? sum[n - 1 - j] : 0);
  if (cnt > m)
    return -inf * inf;
  else
    cnt = m - cnt;
  int l, r;
  for (l = 1, r = n - j; l < r;) {
    int mid = (l + r + 1) / 2;
    if (a[mid - 1].first * mid - sum[mid - 1] <= cnt)
      l = mid;
    else
      r = mid - 1;
  }
  long long realmin =
      (j == n ? mx
              : min(1ll * mx, a[l - 1].first +
                                  (cnt - a[l - 1].first * l + sum[l - 1]) / l));
  if (ret_l) return realmin;
  return 1ll * j * cf + realmin * cm;
}
int main() {
  config_io(false);
  scanf(
      "%d"
      "%lld"
      "%lld"
      "%lld"
      "%lld",
      &n, &mx, &cf, &cm, &m);
  int cntmx = 0;
  for (int i = 0; i < (int)n; ++i) {
    scanf("%lld", &a[i].first);
    a[i].second = i;
    cntmx += (a[i].first == mx);
  }
  sort(a, a + n);
  for (int i = 0; i < (int)n; ++i)
    sum[i] = (i == 0 ? 0 : sum[i - 1]) + a[i].first;
  long long ans = -inf * inf;
  int id;
  for (int j = cntmx; j <= n; ++j) {
    long long rat = solve(j);
    if (rat > ans) ans = rat, id = j;
  }
  int realmin = solve(id, true);
  printf(
      "%lld"
      "\n",
      ans);
  for (int i = n - 1, j = 0; i >= 0 && j < id; --i, ++j) a[i].first = mx;
  for (int i = 0; i < n; ++i)
    if (a[i].first <= realmin) a[i].first = realmin;
  for (int i = 0; i < n; ++i) arr[a[i].second] = a[i].first;
  for (int i = 0; i < n; ++i)
    printf(
        "%lld"
        " ",
        arr[i]);
  return 0;
}
