#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAXN = 1e5 + 4;
pair<int, int> a[MAXN];
ll sum[MAXN];
int n, c_f, c_m, max_a;
ll m;
bool cmp(const pair<int, int> &A, const pair<int, int> &B) {
  return A.second < B.second;
}
int main() {
  cin >> n >> max_a >> c_f >> c_m >> m;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i].first);
    a[i].second = i;
  }
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    sum[i + 1] = sum[i] + a[i].first;
  }
  ll ans = -1;
  ll cur_sum = 0;
  int cur_i = n;
  int ans_i;
  for (int i = n; i >= 0; --i) {
    cur_sum += a[i].first;
    if (max_a * (n - i) - cur_sum > m) break;
    ll min_f = max_a;
    ll cur_m = m - (max_a * (n - i) - cur_sum);
    if (i) {
      while (cur_i > i || (cur_m + sum[cur_i]) / cur_i < a[cur_i - 1].first)
        --cur_i;
      min_f = min(min_f, (cur_m + sum[cur_i]) / cur_i);
    }
    if (ans < min_f * c_m + ll(n - i) * c_f) {
      ans = min_f * c_m + ll(n - i) * c_f;
      ans_i = i;
    }
  }
  cout << ans << "\n";
  ll min_f = max_a;
  ll cur_m = m - (max_a * (n - ans_i) - (sum[n] - sum[ans_i]));
  cur_i = n;
  if (ans_i) {
    while (cur_i > ans_i || (cur_m + sum[cur_i]) / cur_i < a[cur_i - 1].first)
      --cur_i;
    min_f = min(min_f, ll(cur_m + sum[cur_i]) / cur_i);
  }
  for (int i = 0; i < cur_i; ++i) {
    a[i].first = min_f;
  }
  for (int i = ans_i; i < n; ++i) {
    a[i].first = max_a;
  }
  sort(a, a + n, cmp);
  for (int i = 0; i < n; ++i) printf("%d ", a[i].first);
  printf("\n");
}
