#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000;
struct com {
  int x, y;
};
inline bool operator<(com x, com y) { return x.x > y.x; }
inline bool cmp(com x, com y) { return x.y < y.y; }
template <class T>
inline void setmax(T &x, const T &y) {
  if (x < y) x = y;
}
int n, cf, cm, A, ax, ay;
long long m, ans, az;
com a[maxn];
long long s[maxn];
inline bool check(int k, int x) {
  int p = upper_bound(a + k, a + n, (com){x, -1}) - a;
  long long cur = 1ll * (n - p) * x - s[n - 1] + (p ? s[p - 1] : 0);
  return cur <= m;
}
inline int solve(int k) {
  int l = 0, r = A, mid;
  while (r - l > 1) {
    mid = l + r >> 1;
    if (check(k, mid))
      l = mid;
    else
      r = mid - 1;
  }
  return check(k, r) ? r : l;
}
int main() {
  scanf("%d %d %d %d %I64d", &n, &A, &cf, &cm, &m);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i].x), a[i].y = i;
  sort(a, a + n);
  int om = m;
  for (int i = 0; i < n; ++i) s[i] = (i ? s[i - 1] : 0) + a[i].x;
  for (int i = 0;; ++i) {
    int ret = solve(i);
    long long cur = 1ll * i * cf + 1ll * ret * cm;
    if (cur > az) az = cur, ax = i, ay = ret;
    if (i == n) break;
    int r = A - a[i].x;
    if (m < r) break;
    m -= r;
  }
  m = om;
  for (int i = 0; i < ax; ++i) m -= A - a[i].x, a[i].x = A;
  for (int i = ax; i < n; ++i)
    if (a[i].x < ay) m -= ay - a[i].x, a[i].x = ay;
  sort(a, a + n, cmp);
  printf("%I64d\n", az);
  for (int i = 0; i < n; ++i) printf(i == n - 1 ? "%d\n" : "%d ", a[i].x);
  return 0;
}
