#include <bits/stdc++.h>
using namespace std;
const int Nmax = 100000 + 10;
long long m, ans, dif, crt;
long long cost[Nmax], dp[Nmax];
int i, n, A, cf, cm, ind, up, inc;
int rasp[Nmax], to[Nmax];
pair<int, int> a[Nmax];
int main() {
  scanf("%d %d %d %d %I64d", &n, &A, &cf, &cm, &m);
  for (i = 1; i <= n; ++i) {
    scanf("%d", &a[i].first);
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  for (i = n; i; --i) cost[i] = cost[i + 1] + 1LL * (A - a[i].first);
  int j = 0;
  for (i = 1; i <= n + 1; ++i) {
    dp[i] = dp[i - 1] + 1LL * (a[i].first - a[i - 1].first) * (i - 1);
    while (j + 1 < i && dp[j + 1] + cost[i] <= m) j++;
    to[i] = j;
  }
  ans = -1LL;
  for (i = 1; i <= n + 1; ++i)
    if (cost[i] + dp[to[i]] <= m) {
      crt = 0LL;
      if (cf) {
        crt += 1LL * cf * (n - i + 1);
      }
      if (cm) {
        dif = m - cost[i] - dp[to[i]];
        inc =
            (to[i]) ? (int)min(dif / to[i], 1LL * (A - 1 - a[to[i]].first)) : 0;
        if (i == 1)
          crt += 1LL * cm * A;
        else
          crt += 1LL * cm * (a[to[i]].first + inc);
      }
      if (crt > ans) ans = crt, ind = i, up = inc;
    }
  for (i = 1; i <= n; ++i)
    if (i <= to[ind])
      rasp[a[i].second] = a[to[ind]].first + up;
    else if (ind <= i)
      rasp[a[i].second] = A;
    else
      rasp[a[i].second] = a[i].first;
  printf("%I64d\n", ans);
  for (i = 1; i <= n; ++i) printf("%d ", rasp[i]);
  return 0;
}
