#include <bits/stdc++.h>
using namespace std;
int s[1 << 20];
int p[1 << 20];
long long sum[1 << 20];
int as[1 << 20];
bool cmp(int a, int b) { return s[a] < s[b]; }
int lg = 0;
long long can(int mn, int lim) {
  int ind = 0;
  for (int k = 1 << lg; k; k >>= 1)
    if (k + ind <= lim && s[p[k + ind]] <= mn) ind += k;
  return -sum[ind] + 1ll * mn * ind;
}
int main(void) {
  long long ans = 0;
  int n, A, dx, dy;
  long long m;
  cin >> n >> A >> dx >> dy >> m;
  int MIn = 2e9;
  for (int i = 1; i <= n; ++i)
    cin >> s[i], MIn = min(MIn, s[i]), ans += (s[i] == A) * dx, p[i] = i;
  ans += 1ll * MIn * dy;
  sort(p + 1, p + 1 + n, cmp);
  for (int i = 1; i <= n; ++i) sum[i] = sum[i - 1] + s[p[i]];
  int how = -1;
  while ((1ll << (lg + 1)) <= A) ++lg;
  int changed = 0;
  s[n + 1] = A;
  p[n + 1] = n + 1;
  int for_now = n + 1, for_mn = A;
  for (int i = n + 1; i; --i) {
    m -= A - s[p[i]];
    if (m < 0) break;
    ++how;
    long long cnt = 1ll * how * dx;
    int r = 0;
    for (int k = 1 << lg; k; k >>= 1)
      if (r + k <= A && can(r + k, i - 1) <= m) r += k;
    cnt += 1ll * r * dy;
    if (cnt > ans) {
      changed = 1;
      ans = cnt;
      for_mn = r;
      for_now = i;
    }
  }
  if (changed) {
    for (int i = n; i >= for_now; --i) as[p[i]] = A;
    for (int i = 1; i < for_now; ++i) as[p[i]] = max(for_mn, s[p[i]]);
  } else {
    for (int i = 1; i <= n; ++i) as[i] = s[i];
  }
  cout << ans << '\n';
  for (int i = 1; i <= n; ++i) cout << as[i] << ' ';
  cout << '\n';
  return 0;
}
