#include <bits/stdc++.h>
using namespace std;
pair<long long, int> a[100005];
long long dp[100005];
long long A;
long long fin[100005];
long long f(int x, long long m) {
  if (x == 0) return A;
  long long l = 0, r = A, mid, ans = -1;
  while (l <= r) {
    mid = (l + r) / 2;
    int last_idx =
        upper_bound(a + 1, a + x + 1, make_pair(mid, 1000000000)) - a;
    last_idx--;
    long long cost = mid * (long long)last_idx - dp[last_idx];
    if (cost <= m) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  return ans;
}
int main() {
  int n, idx;
  long long cf, cm, m, inc = 0, max_force = -1, mn_val;
  scanf("%d%lld%lld%lld%lld", &n, &A, &cf, &cm, &m);
  assert(n >= 1 && n <= 100000);
  assert(A >= 1 && A <= 1000000000);
  assert(m >= 0 && m <= 1000000000000000LL);
  assert(cf >= 0 && cf <= 1000);
  assert(cm >= 0 && cm <= 1000);
  a[0].first = 0;
  a[0].second = 0;
  for (int i = 1; i <= n; i++)
    scanf("%d", &a[i].first), a[i].second = i,
                              assert(a[i].first >= 0 && a[i].first <= A);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) dp[i] = dp[i - 1] + a[i].first;
  for (int i = n; i >= 0; i--) {
    long long max_minval = f(i, m - inc);
    if (max_minval == -1LL) continue;
    long long val = max_minval * cm + cf * (long long)(n - i);
    if (max_force < val) {
      idx = i + 1;
      max_force = val;
      mn_val = max_minval;
    }
    inc += (A - a[i].first);
    if (m - inc < 0LL) break;
  }
  printf("%lld\n", max_force);
  for (int i = 1; i < idx; i++) {
    if (a[i].first < mn_val) a[i].first = mn_val;
  }
  for (int i = idx; i <= n; i++) a[i].first = A;
  for (int i = 1; i <= n; i++) fin[a[i].second] = a[i].first;
  for (int i = 1; i <= n; i++) printf("%lld ", fin[i]);
  return 0;
}
