#include <bits/stdc++.h>
const int inf = 1e9 + 5;
const long long linf = 5e18 + 5;
const long double eps = 1e-7;
const long double pi = 2 * acos(0);
const int dd = 2e5 + 7;
const int maxn = 2e3 + 10;
using namespace std;
vector<pair<long long, long long> > qwe;
long long raz[dd];
long long n, a, cf, cm, m;
pair<long long, long long> ask(long long x, long long q) {
  if (!q) return make_pair(a, 0);
  int l = 0;
  int r = q;
  while (l != r - 1) {
    int m = (l + r) / 2;
    if (raz[m] > x)
      r = m;
    else
      l = m;
  }
  l++;
  return make_pair(min(qwe[qwe.size() - l].first + (x - raz[l - 1]) / l, a), l);
}
int main() {
  ios_base::sync_with_stdio(0);
  if (0) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  } else {
    if (!01) {
      freopen(
          "sufpref"
          ".in",
          "r", stdin);
      freopen(
          "sufpref"
          ".out",
          "w", stdout);
    }
  }
  cin >> n >> a >> cf >> cm >> m;
  for (long long i = 0; i < n; ++i) {
    long long x;
    cin >> x;
    qwe.push_back(make_pair(x, i));
  }
  sort(qwe.begin(), qwe.end());
  long long cntmax = 0;
  while (cntmax < qwe.size() && qwe[qwe.size() - 1 - cntmax].first == a)
    cntmax++;
  long long sum = 0;
  for (long long i = 1; i < n; ++i)
    sum += (qwe[i].first - qwe[i - 1].first) * (i), raz[i] = sum;
  long long bestans = cntmax * cf + qwe[0].first * cm;
  long long bestcnt = cntmax;
  long long bestmin = qwe[0].first;
  long long bestind = 1;
  reverse(qwe.begin(), qwe.end());
  sum = 0;
  for (long long i = cntmax; i < n + 1; ++i) {
    if (i) sum += a - qwe[i - 1].first;
    if (sum > m) break;
    pair<long long, long long> zxc = ask(m - sum, n - i);
    long long minnow = zxc.first;
    long long now = (i)*cf + minnow * cm;
    if (bestans < now) {
      bestans = now;
      bestcnt = i;
      bestmin = zxc.first;
      bestind = zxc.second;
    }
  }
  vector<long long> asd(n);
  for (long long i = 0; i < bestcnt; ++i) {
    asd[qwe[i].second] = a;
  }
  for (long long i = 0; i < bestind; ++i)
    asd[qwe[qwe.size() - i - 1].second] = bestmin;
  for (long long i = bestcnt; i < qwe.size() - bestind; ++i)
    asd[qwe[i].second] = qwe[i].first;
  cout << bestans << "\n";
  for (long long i = 0; i < asd.size(); ++i) cout << asd[i] << ' ';
  return 0;
}
