#include <bits/stdc++.h>
using namespace std;
const int MAXN = int(1e5 + 5);
int n, A, cf, cm;
int a[MAXN], tmp1[MAXN], tmp2[MAXN];
long long s[MAXN], m;
int _max = 0, _min = int(1e9);
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 0; i < n; i++) tmp1[i] = i, cin >> a[i];
  if (!cm && !cf) {
    puts("0");
    for (int i = 0; i < n; i++) cout << a[i] << ' ';
    return 0;
  }
  sort(tmp1, tmp1 + n, cmp);
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    s[i] = a[i];
    i ? s[i] += s[i - 1] : 0;
  }
  long long ret, ans = 0;
  a[n] = A;
  for (int i = n; i >= 0; i--) {
    ret = m - (1ll * A * (n - i) - (s[n - 1] - (i ? s[i - 1] : 0)));
    if (ret < 0) break;
    if (!cm) {
      ans = 1ll * (n - i) * cf;
      _max = n - i;
      _min = 0;
      continue;
    }
    long long l = a[0], r = A, mid;
    while (l < r) {
      mid = r - ((r - l) >> 1);
      int k = upper_bound(a, a + n, mid) - a;
      k = min(k, i);
      if (ret >= 1ll * k * mid - (k ? s[k - 1] : 0))
        l = mid;
      else
        r = mid - 1;
    }
    long long force = 1ll * (n - i) * cf + 1ll * l * cm;
    if (force > ans) {
      ans = force;
      _max = n - i;
      _min = l;
    }
  }
  cout << ans << endl;
  for (int i = 0; i < n - _max; i++) tmp2[tmp1[i]] = max(_min, a[i]);
  for (int i = n - _max; i < n; i++) tmp2[tmp1[i]] = A;
  for (int i = 0; i < n; i++) cout << tmp2[i] << ' ';
  puts("");
  return 0;
}
