#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 4;
long long A, n, cf, cm, m;
long long a[MAXN], b[MAXN];
long long dp[MAXN];
int rcnt[MAXN];
void solve() {
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  memcpy(b, a, (n + 1) * sizeof(long long));
  sort(a + 1, a + n + 1);
  a[n + 1] = A;
  for (int i = 1; i <= n + 1; ++i) {
    dp[i] = dp[i - 1] + (a[i] - a[i - 1]) * (i - 1);
  }
  for (int i = n; i > 0; --i) {
    if (a[i] == a[i + 1])
      rcnt[i] = rcnt[i + 1] + 1;
    else
      rcnt[i] = 1;
  }
  long long res = 0, t, sp = 0, dist, du;
  int mi = -1, ma = -1, dem = 0;
  if (dp[n + 1] <= m) {
    dem = 1e9;
    mi = ma = 0;
    res = n * cf + cm * A;
  } else
    for (int k = n + 1; k > 0; --k) {
      t = cf * (n + 1 - k);
      sp += A - a[k];
      if (sp > m) break;
      if (sp == m) {
        t += a[1] * cm;
        if (t > res) {
          res = t;
          ma = a[k];
          mi = -1;
          dem = rcnt[k];
        }
      } else {
        auto it = lower_bound(dp, dp + k, m - sp);
        if (*it != m - sp) it--;
        dist = it - dp;
        if (a[dist] == a[k]) dist = k;
        du = m - sp - *it;
        t += (a[dist] + du / dist) * cm;
        if (t > res) {
          res = t;
          mi = a[dist] + du / dist;
          ma = a[k];
          dem = rcnt[k];
        }
      }
    }
  if (cf == 0) ma = 1e9 + 1;
  if (cm == 0) mi = -1;
  cout << res << endl;
  for (int i = 1; i <= n; ++i) {
    if (b[i] > ma)
      printf("%d ", A);
    else if (b[i] == ma && dem > 0) {
      printf("%d ", A);
      dem--;
    } else if (b[i] < mi)
      printf("%d ", mi);
    else
      printf("%d ", b[i]);
  }
}
int main() {
  solve();
  return 0;
}
