#include <bits/stdc++.h>
using namespace std;
long long rdtsc() {
  long long tmp;
  asm("rdtsc" : "=A"(tmp));
  return tmp;
}
inline int myrand() { return abs((rand() << 15) ^ rand()); }
inline int rnd(int x) { return myrand() % x; }
const int INF = (int)1.01e9;
const long double EPS = 1e-9;
const long double PI = acos(-1.0L);
void precalc() {}
int n, A, cf, cm;
long long m;
const int maxn = (int)1e5 + 10;
pair<int, int> a[maxn];
int ans[maxn];
bool read() {
  if (scanf("%d%d%d%d"
            "%lld",
            &n, &A, &cf, &cm, &m) < 5) {
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i].first);
    a[i].second = i;
    ans[i] = a[i].first;
  }
  return 1;
}
long long sum[maxn];
void solve() {
  sort(a, a + n);
  sum[0] = 0;
  for (int i = 0; i < n; ++i) {
    sum[i + 1] = sum[i] + a[i].first;
  }
  long long res = -1;
  int rwhole = -1, rmn = -1;
  long long left = m;
  for (int whole = 0; whole <= n; ++whole) {
    if (whole) {
      left -= A - a[n - whole].first;
      if (left < 0) {
        break;
      }
    }
    int l = 0, r = A + 1;
    while (l + 1 < r) {
      int mid = (l + r) / 2;
      int pos = lower_bound(a, a + n - whole, make_pair(mid, -INF)) - a;
      long long need = (long long)mid * pos - sum[pos];
      if (need <= left) {
        l = mid;
      } else {
        r = mid;
      }
    }
    long long value = whole * (long long)cf + (long long)l * cm;
    if (res < value) {
      res = value;
      rwhole = whole;
      rmn = l;
    }
  }
  printf(
      "%lld"
      "\n",
      res);
  for (int i = 0; i < n; ++i) {
    ans[i] = max(ans[i], rmn);
  }
  for (int i = 0; i < rwhole; ++i) {
    ans[a[n - 1 - i].second] = A;
  }
  for (int i = 0; i < n; ++i) {
    printf("%d%c", ans[i], " \n"[i == n - 1]);
  }
}
int main() {
  srand(rdtsc());
  precalc();
  while (1) {
    if (!read()) {
      break;
    }
    solve();
  }
  return 0;
}
