#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
int n, cf, cm, A;
long long m;
pair<int, int> a[100100];
int ans[100100];
long long sum[100100];
long long check(int pos, int su) {
  int pp = upper_bound(a, a + n, make_pair(su, inf)) - a;
  pp--;
  if (pp < pos) {
    if (pp < 0) return 0;
    long long cur = sum[0] - sum[pp + 1];
    return su * 1ll * (pp + 1) - cur;
  }
  long long cur = sum[0] - sum[pos + 1];
  return su * 1ll * (pos + 1) - cur;
}
int get(int pos, long long need) {
  int l = 0, r = A - 1;
  int ans = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(pos, mid) <= need) {
      ans = mid;
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  return ans;
}
int main() {
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a, a + n);
  for (int i = n - 1; i >= 0; i--) {
    sum[i] = (sum[i + 1] + a[i].first);
  }
  if (A * 1ll * n - sum[0] <= m) {
    cout << cm * 1ll * A + cf * 1ll * n << endl;
    for (int i = 0; i < n; i++) {
      printf("%d ", A);
    }
    cout << endl;
    return 0;
  }
  long long cur = get(n, m) * 1ll * cm;
  int ind = n;
  cerr << cur << endl;
  for (int i = n - 1; i >= 0; i--) {
    if ((n - i) * 1ll * A - sum[i] > m) break;
    int ans = get(i - 1, m - (n - i) * 1ll * A + sum[i]);
    if (cur < cf * 1ll * (n - i) + ans * 1ll * cm) {
      cur = cf * 1ll * (n - i) + ans * 1ll * cm;
      ind = i;
    }
  }
  m -= (n - ind) * 1ll * A - sum[ind];
  int ge = get(ind - 1, m);
  for (int i = n - 1; i >= ind; i--) {
    ans[a[i].second] = A;
  }
  for (int i = 0; i < ind; i++) {
    ans[a[i].second] = a[i].first;
    if (a[i].first > ge) continue;
    int need = ge - a[i].first;
    ans[a[i].second] = ge;
  }
  cout << cur << endl;
  for (int i = 0; i < n; i++) printf("%d ", ans[i]);
  return 0;
}
