#include <bits/stdc++.h>
using namespace std;
long long rse, ans, mid, l, r;
long long a[100020], res = -1;
long long sum[100020];
long long n, i, cf, cm, A, m, mi, en, mx;
pair<long long, long long> P[100020];
int main() {
  cin >> n >> A >> cf >> cm >> m;
  for (i = 1; i <= n; i++)
    scanf("%d", &a[i]), P[i].first = a[i], P[i].second = i;
  sort(a + 1, a + n + 1);
  sort(P + 1, P + n + 1);
  for (i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i];
  for (i = n; i >= 0 && m >= 0; i--) {
    l = 1;
    r = i;
    ans = -1;
    while (l <= r) {
      mid = (l + r) / 2;
      if (sum[mid] + m >= 1LL * a[mid] * mid) {
        ans = a[mid] + (sum[mid] + m - a[mid] * mid) / mid;
        ans = min(ans, A);
        l = mid + 1;
      } else
        r = mid - 1;
    }
    if (ans == -1) ans = A;
    long long now = 1LL * (n - i) * cf + ans * cm;
    if (res < now) {
      mi = mid;
      en = i;
      res = now;
      mx = ans;
    }
    m -= (A - a[i]);
  }
  cout << res << endl;
  for (i = 1; i <= mi; i++)
    if (P[i].first < mx) P[i].first = mx;
  for (i = n; i > en; i--) P[i].first = A;
  for (i = 1; i <= n; i++) swap(P[i].first, P[i].second);
  sort(P + 1, P + n + 1);
  for (i = 1; i <= n; i++) printf("%d ", P[i].second);
  cout << endl;
}
