#include <bits/stdc++.h>
using namespace std;
int n, MAX, T1, T2;
long long m;
int B[100010], C[100010];
long long sum[100010];
struct node {
  int v, p;
  bool operator<(const node &ano) const { return v > ano.v; }
} A[100010];
int yes[100010];
int ok(int L, long long m, int t) {
  int p = upper_bound(B + 1, B + n + 1, L) - B;
  --p;
  p = min(p, n - t);
  return (long long)L * p - sum[p] <= m;
}
int main() {
  scanf("%d%d%d%d%I64d", &n, &MAX, &T1, &T2, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &A[i].v);
    A[i].p = i;
    C[i] = B[i] = A[i].v;
  }
  sort(A + 1, A + n + 1);
  sort(B + 1, B + n + 1);
  for (int i = 1; i <= n; ++i) sum[i] = sum[i - 1] + B[i];
  long long ans = -1;
  int ansp = 0, cnt = 0;
  for (int i = 0; i <= n; ++i) {
    if (i) {
      m -= MAX - A[i].v;
      if (m < 0) break;
    }
    int l = 0, r = MAX + 1;
    while (l < r) {
      int mid = (l + r) / 2;
      if (ok(mid, m, i))
        l = mid + 1;
      else
        r = mid;
    }
    --l;
    if ((long long)i * T1 + (long long)l * T2 > ans)
      ans = (long long)i * T1 + (long long)l * T2, ansp = l, cnt = i;
  }
  printf("%I64d\n", ans);
  for (int i = 1; i <= cnt; ++i) yes[A[i].p] = 1;
  for (int i = 1; i <= n; ++i) {
    if (yes[i])
      C[i] = MAX;
    else if (C[i] <= ansp)
      C[i] = ansp;
    printf("%d ", C[i]);
  }
  return 0;
}
