#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
using namespace std;
void itval(istream_iterator<string> it) {}
template <typename T, typename... Args>
void itval(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  itval(++it, args...);
}
const long long int MOD = 1e9 + 7;
template <typename T>
inline void print(T x) {
  cout << x << "\n";
}
template <typename T>
inline void printvec(T x) {
  for (auto a : x) cout << a << ' ';
  cout << '\n';
}
struct custom {
  bool operator()(const pair<int, pair<int, int> > &p1,
                  const pair<int, pair<int, int> > &p2) const {
    return p1.first < p2.first;
  }
};
long long int get_pow(long long int a, long long int b, long long int M = MOD) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % M;
    a = (a * a) % M;
    b >>= 1;
  }
  return res;
}
const long long int N = 1e4 + 1, inf = 2e18;
void solve() {
  long long int n, A, cf, cm, m;
  cin >> n >> A >> cf >> cm >> m;
  vector<pair<long long int, long long int> > v(n);
  for (long long int i = (long long int)0; i < (long long int)(n); i++) {
    cin >> v[i].first;
    v[i].second = i;
  }
  sort(v.begin(), v.end());
  vector<long long> pref(n + 1);
  long long int cnt = 0, mi = inf;
  for (long long int i = (long long int)0; i < (long long int)(n); i++) {
    pref[i] = v[i].first;
    if (i) pref[i] += pref[i - 1];
    if (v[i].first == A) cnt++;
  }
  pref[n] = pref[n - 1];
  long long int ans = cnt * cf + cm * v[0].first, c = 0, s = 0;
  long long int lt = v[0].first, ac = cnt;
  if (m > 0) {
    long long int lo = v[0].first, hi = A + 1, lef = m;
    while (lo + 1 < hi) {
      long long int mid = (lo + hi) >> 1;
      long long int it =
          lower_bound(v.begin(), v.end(), make_pair(mid, -1ll)) - v.begin();
      if (it == 0) {
        lo = mid;
        continue;
      } else if ((it)*mid - pref[it - 1] <= lef) {
        lo = mid;
      } else {
        hi = mid;
      }
    }
    if (ans < cnt * cf + lo * cm) {
      ans = cnt * cf + lo * cm;
      lt = lo;
    }
  }
  for (long long int j = n - 1; j >= 0; j--) {
    c++;
    if (v[j].first == A) {
      continue;
    }
    s += (A - v[j].first);
    if (s > m) break;
    long long int lef = m - s;
    long long int lo = v[0].first, hi = A + 1;
    while (lo + 1 < hi) {
      long long int mid = (lo + hi) >> 1;
      long long int it =
          upper_bound(v.begin(), v.end(), make_pair(mid, -1ll)) - v.begin();
      it = min(it, j);
      it = max(0ll, it);
      if (it == 0) {
        lo = mid;
        continue;
      } else if ((it)*mid - pref[it - 1] <= lef) {
        lo = mid;
      } else {
        hi = mid;
      }
    }
    if (ans < c * cf + lo * cm) {
      ans = c * cf + lo * cm;
      lt = lo;
      ac = c;
    }
  }
  cout << ans << '\n';
  vector<long long> res(n);
  for (int j = n - 1, c = 0; j >= 0 && c < ac; c++, j--) {
    res[v[j].second] = A;
    v[j].first = A;
  }
  for (long long int i = (long long int)0; i < (long long int)(n); i++) {
    v[i].first = max(v[i].first, lt);
    res[v[i].second] = v[i].first;
  }
  printvec(res);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int test = 1;
  clock_t z = clock();
  for (long long int tes = (long long int)0; tes < (long long int)(test);
       tes++) {
    solve();
  }
  fprintf(stderr, "Total Time:%.4f\n", (double)(clock() - z) / CLOCKS_PER_SEC),
      fflush(stderr);
  return 0;
}
