#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const double PI = 3.1415926535897932384626433832795;
const double eps = 1e-5;
long long int n, A, cmx, cmn, M, Mt, sfs[100007], answ[100007];
pair<long long int, long long int> m[100007];
bool f1(pair<long long int, long long int> a,
        pair<long long int, long long int> b) {
  return a > b;
}
long long int f(long long int s, long long int t) {
  long long int m1, l1, r1, e;
  l1 = s;
  r1 = n - 1;
  while (r1 - l1 > 1) {
    m1 = (r1 + l1) / 2;
    if (m[m1].first >= t) {
      l1 = m1;
    } else {
      r1 = m1;
    }
  }
  if (m[l1].first >= t)
    e = r1;
  else
    e = l1;
  if (t * (n - e) - sfs[e] <= M)
    return 1;
  else
    return 0;
}
void print(long long int ansi, long long int anse) {
  long long int i, j;
  for (i = 0; i < ansi; i++) {
    Mt -= (A - m[i].first);
    answ[m[i].second] = A;
  }
  for (i = ansi; i < n; i++) {
    if (anse > m[i].first) Mt -= (anse - m[i].first);
    answ[m[i].second] = max(anse, m[i].first);
  }
  for (i = ansi; i < n; i++) {
    if (Mt > 0) {
      answ[m[i].second]++;
      Mt--;
    }
  }
  for (i = 0; i < n; i++) printf("%I64d ", answ[i]);
}
void sol() {
  long long int i, j, x, s, l1, r1, m1, ans = -1, ansi, e, gls = 0, anse;
  scanf("%I64d%I64d%I64d%I64d%I64d", &n, &A, &cmx, &cmn, &M);
  Mt = M;
  for (i = 0; i < n; i++) {
    scanf("%I64d", &x);
    m[i].first = x;
    m[i].second = i;
    gls += x;
  }
  sort(m, m + n, f1);
  sfs[n] = 0;
  for (i = n - 1; i >= 0; i--) {
    sfs[i] = sfs[i + 1] + m[i].first;
  }
  for (i = 0; i < n && m[i].first == A; i++)
    ;
  s = i;
  for (; i < n; i++) {
    l1 = 0;
    r1 = A;
    while (r1 - l1 > 1) {
      m1 = (l1 + r1) / 2;
      if (f(i, m1) == 1) {
        l1 = m1;
      } else {
        r1 = m1;
      }
    }
    if (f(i, r1) == 1)
      e = r1;
    else
      e = l1;
    if (ans < i * cmx + e * cmn) {
      ans = i * cmx + e * cmn;
      ansi = i;
      anse = e;
    }
    M -= A - m[i].first;
    if (M < 0) {
      printf("%I64d\n", ans);
      print(ansi, anse);
      return;
    }
  }
  if (n * A - gls <= Mt) {
    printf("%I64d\n", cmx * n + A * cmn);
    for (i = 0; i < n; i++) {
      printf("%I64d ", A);
    }
    return;
  }
  printf("%I64d\n", ans);
  print(ansi, anse);
  return;
}
int main() {
#pragma comment(linker, "/STACK:268435456")
  sol();
  return 0;
}
