#include <bits/stdc++.h>
using namespace std;
const int N = int(3e5);
long long a[N], n, A, cf, cm;
long long m;
int cur;
pair<long long, long long> p[N];
long long second[N];
long long ans, val[N], pos, sum[N], M, t;
bool check(int i, int m) {
  int l = i, r = n + 1;
  while (r - l > 1) {
    int mid = (r + l) / 2;
    if (p[mid].first >= m)
      l = mid;
    else
      r = mid;
  }
  return (1ll * (n - l) * m - (sum[n] - sum[l]) <= M);
}
long long finds(int i) {
  int l = p[n].first, r = A + 1;
  while (r - l > 1) {
    int mid = (r + l) / 2;
    if (check(i, mid))
      l = mid;
    else
      r = mid;
  }
  return l;
}
int main() {
  scanf("%I64d%I64d%I64d%I64d%I64d", &n, &A, &cf, &cm, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i].first);
    p[i].second = i;
  }
  sort(p + 1, p + n + 1);
  reverse(p + 1, p + n + 1);
  for (int i = 1; i <= n; i++) {
    second[i] = second[i - 1] + A - p[i].first;
    sum[i] = sum[i - 1] + p[i].first;
  }
  M = m;
  t = finds(0);
  t = min(t, A);
  val[0] = t;
  ans = t * cm;
  for (int i = 1; i <= n; i++) {
    if (second[i] <= m) {
      M = m - second[i];
      t = finds(i);
      t = min(t, A);
      val[i] = t;
      if (ans < t * cm + cf * i) {
        ans = t * cm + cf * i;
        pos = i;
      }
    }
  }
  printf("%I64d\n", ans);
  for (int i = 1; i <= pos; i++) {
    a[p[i].second] = A;
  }
  for (int i = pos + 1; i <= n; i++) {
    a[p[i].second] = max(p[i].first, val[pos]);
  }
  for (int i = 1; i <= n; i++) {
    printf("%I64d ", a[i]);
  }
  return 0;
}
