#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
int a[N], c[N];
long long lef[N], rig[N];
int n, A, cf, cm;
long long m;
pair<int, int> b[N];
int main() {
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &b[i].first);
    b[i].second = i;
  }
  sort(b + 1, b + n + 1);
  for (int i = 1; i <= n; ++i) a[i] = b[i].first;
  for (int i = n; i >= 1; --i) {
    lef[n - i + 1] = lef[n - i] + A - a[i];
  }
  for (int i = 1; i <= n; ++i) rig[i] = rig[i - 1] + a[i];
  long long ans = 0;
  int ans1 = 0, ans2 = 0;
  if (lef[n] <= m) {
    ans = 1ll * A * cm + 1ll * n * cf;
    ans1 = A;
    ans2 = n;
  }
  for (int i = 0; i < n; ++i) {
    long long use = lef[i];
    if (use > m) break;
    int l = 0, r = A + 1;
    while (l < r - 1) {
      int mid = l + r >> 1;
      long long pos = lower_bound(a + 1, a + n - i + 1, mid) - a - 1;
      long long cost = pos * mid - rig[pos];
      if (cost + use > m)
        r = mid;
      else
        l = mid;
    }
    long long res = 1ll * l * cm + 1ll * i * cf;
    if (res >= ans) {
      ans = res;
      ans1 = l;
      ans2 = i;
    }
  }
  cout << ans << endl;
  for (int i = 1; i <= n; ++i) {
    c[b[i].second] = b[i].first;
    if (b[i].first <= ans1) c[b[i].second] = ans1;
    if (i >= n - ans2 + 1) c[b[i].second] = A;
  }
  for (int i = 1; i <= n; ++i) {
    printf("%d ", c[i]);
  }
  puts("");
}
