#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
inline long long min(long long x, long long y) {
  if (x < y)
    return x;
  else
    return y;
}
pair<long long, long long> num[maxn];
bool pred(const pair<long long, long long>& x,
          const pair<long long, long long>& y) {
  return x.first < y.first;
}
long long mir[maxn], cf, cm, A, n, m, d, cnt, oans;
long long cost[maxn], tofull[maxn], ans, ansd, ansx, ansi;
int main() {
  scanf("%I64d%I64d%I64d%I64d%I64d", &n, &A, &cf, &cm, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%I64d", &num[i].first);
    num[i].second = i;
    if ((mir[i] = num[i].first) == A) ++cnt;
  }
  sort(num, num + n, pred);
  d = num[0].first;
  ans = oans = cm * d + cnt * cf;
  for (int i = 1; i < n; ++i)
    cost[i] = cost[i - 1] + (num[i].first - num[i - 1].first) * i;
  for (int i = n - 1; i >= 0; --i)
    tofull[i] = tofull[i + 1] + (A - num[i].first);
  for (int i = n + 1 - 1; i >= 0; --i) {
    long long res = m;
    res -= tofull[i];
    if (res < 0) break;
    long long x = min(i, lower_bound(cost, cost + n, res) - cost);
    if (x > 0) d = min(A, (res - cost[x - 1]) / x + num[x - 1].first);
    long long t = cm * d + cf * (n - i);
    if (t > ans) {
      ans = t;
      ansd = d;
      ansx = x;
      ansi = i;
    }
  }
  if (ans > oans) {
    for (int i = 0; i < ansx; ++i) mir[num[i].second] = ansd;
    for (int i = ansi; i < n; ++i) mir[num[i].second] = A;
  }
  printf("%I64d\n", ans);
  printf("%I64d", mir[0]);
  for (int i = 1; i < n; ++i) printf(" %I64d", mir[i]);
  printf("\n");
  return 0;
}
