#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000;
vector<pair<long long, int> > arr(maxn);
long long pre[maxn];
long long finale[maxn];
int n, A, cf, cm;
long long calc(int l, int r, long long val) {
  int pos = (int)(lower_bound(arr.begin() + 1, arr.begin() + r + 1,
                              make_pair(val, -1)) -
                  arr.begin());
  pos -= 1;
  if (pos < l) return 0;
  r = pos;
  long long ret = 1LL * (r - l + 1) * val - (pre[r] - pre[l - 1]);
  return ret;
}
int main() {
  long long m;
  scanf("%d", &n);
  scanf("%d", &A);
  scanf("%d", &cf);
  scanf("%d", &cm);
  scanf("%I64d", &m);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &arr[i].first);
    arr[i].second = i;
  }
  long long ans = 0;
  sort(arr.begin() + 1, arr.begin() + n + 1);
  for (int i = 1; i <= n; i++) pre[i] = pre[i - 1] + arr[i].first;
  long long tempM = m;
  for (int i = n + 1; i >= 1; i--) {
    if (i <= n) m -= (A - arr[i].first);
    if (m < 0) break;
    int lo = 0, hi = A;
    while (lo < hi) {
      int mid = (lo + hi + 1) >> 1;
      if (calc(1, i - 1, mid) <= m)
        lo = mid;
      else
        hi = mid - 1;
    }
    ans = max(ans, 1LL * lo * cm + 1LL * (n + 1 - i) * cf);
  }
  m = tempM;
  cout << ans << "\n";
  for (int i = n + 1; i >= 1; i--) {
    if (i <= n) m -= (A - arr[i].first);
    if (m < 0) break;
    int lo = 0, hi = A;
    while (lo < hi) {
      int mid = (lo + hi + 1) >> 1;
      if (calc(1, i - 1, mid) <= m)
        lo = mid;
      else
        hi = mid - 1;
    }
    long long cost = 1LL * lo * cm + 1LL * (n + 1 - i) * cf;
    if (cost == ans) {
      for (int a = i; a <= n; a++) finale[arr[a].second] = A;
      for (int a = 1; a < i; a++)
        finale[arr[a].second] = max(arr[a].first, 1LL * lo);
      for (int a = 1; a <= n; a++) cout << finale[a] << " ";
      break;
    }
  }
  return 0;
}
