#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long double eps = 1e-7;
const int inf = 1000000010;
const long long INF = 10000000000010LL;
const int mod = 1000000007;
const int MAXN = 100010;
long long n, m, u, v, x, y, t, a, b, ans, mx, cf, cm, cnt;
pair<long long, long long> A[MAXN];
long long val[MAXN];
long long out[MAXN];
long long ps[MAXN];
long long ps2[MAXN];
long long f(long long x, int t) {
  long long dwn = 0, up = mx + 1;
  while (up - dwn > 1) {
    long long mid = (dwn + up) / 2;
    long long tmp = lower_bound(val + 1, val + n - t + 1, mid) - val - 1;
    if (tmp * mid - ps[tmp] > x)
      up = mid;
    else
      dwn = mid;
  }
  return dwn;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> mx >> cf >> cm >> m;
  for (int i = 1; i <= n; i++) {
    cin >> A[i].first;
    A[i].second = i;
  }
  sort(A + 1, A + n + 1);
  for (int i = 1; i <= n; i++) val[i] = A[i].first;
  val[n + 1] = INF;
  for (int i = 1; i <= n; i++) ps[i] = ps[i - 1] + val[i];
  for (int i = 1; i <= n; i++) ps2[i] = ps2[i - 1] + val[n - i + 1];
  for (int i = 0; i <= n; i++) {
    long long x = mx * i - ps2[i];
    if (x > m) break;
    long long t = f(m - x, i) * cm + i * cf;
    if (t >= ans) {
      ans = t;
      cnt = i;
    }
  }
  cout << ans << endl;
  long long x = mx * cnt - ps2[cnt];
  long long t = f(m - x, cnt);
  for (int i = 0; i < cnt; i++) A[n - i].first = mx;
  for (int i = 1; A[i].first < t; i++) A[i].first = t;
  for (int i = 1; i <= n; i++) out[A[i].second] = A[i].first;
  for (int i = 1; i <= n; i++) cout << out[i] << ' ';
  return 0;
}
