#include <bits/stdc++.h>
using namespace std;
long long pre[100010], a[100010];
pair<long long, int> b[100010];
long long out[100010];
int n;
long long s(int i, int j) {
  long long ret = pre[j];
  if (i) ret -= pre[i - 1];
  return ret;
}
inline bool func(long long mid, long long max_index, long long m) {
  long long pos = upper_bound(a, a + n, mid) - a;
  --pos;
  if (pos < 0) return 1;
  pos = min(pos, max_index);
  long long val = (pos + 1) * mid - pre[pos];
  if (val > m) return 0;
  return 1;
}
int main() {
  long long i, A, cf, cm, m;
  long long maxi, maxmid;
  scanf("%d", &n);
  scanf("%lld", &A);
  scanf("%lld", &cf);
  scanf("%lld", &cm);
  scanf("%lld", &m);
  long long ans = -1;
  for (i = 0; i < n; ++i) {
    scanf("%lld", &a[i]);
    b[i] = make_pair(a[i], i);
  }
  sort(a, a + n);
  sort(b, b + n);
  pre[0] = a[0];
  for (i = 1; i < n; ++i) pre[i] = pre[i - 1] + a[i];
  for (i = 0; i < n; ++i) {
    long long val = i * A - (pre[n - 1] - pre[n - 1 - i]);
    if (val > m) continue;
    long long lo = a[0], hi = A, mid;
    while (lo < hi) {
      mid = (lo + hi) / 2;
      if (!func(mid, n - 1 - i, m - val))
        hi = mid;
      else
        lo = mid + 1;
    }
    mid = (lo + hi) / 2;
    if (!func(mid, n - 1 - i, m - val)) --mid;
    if (cf * i + cm * mid > ans) {
      maxmid = mid;
      maxi = i;
    }
    ans = max(ans, cf * i + cm * mid);
  }
  long long val = n * A - pre[n - 1];
  if (val <= m) {
    if (cf * n + cm * A > ans) {
      maxi = n;
      maxmid = A;
    }
    ans = max(ans, cf * n + cm * A);
  }
  for (i = n - 1; i > n - 1 - maxi; --i) a[i] = A;
  for (i = 0; i < n; ++i) a[i] = max(a[i], maxmid);
  printf("%lld\n", ans);
  for (i = 0; i < n; ++i) out[b[i].second] = a[i];
  for (i = 0; i < n; ++i) printf("%lld ", out[i]);
}
