#include <bits/stdc++.h>
const int N = 231231;
using namespace std;
long long n, A, cf, cm, m;
long long starts[N];
vector<pair<int, int> > skills;
long long pref_sum[N];
long long bal[N];
long long ans;
long long ans1, ans2;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 0; i < n; i++) {
    int val;
    cin >> val;
    skills.push_back(make_pair(val, i));
    starts[i] = val;
  }
  sort(skills.begin(), skills.end());
  for (int i = 0; i < n; i++) {
    pref_sum[i + 1] = pref_sum[i] + skills[i].first;
  }
  ans = -100;
  bal[0] = 0;
  for (int i = 1; i <= n; i++) {
    bal[i] = 1ll * skills[i - 1].first * i - pref_sum[i];
  }
  for (int mx = n; mx >= 0; mx--) {
    long long need = 1ll * A * mx - (pref_sum[n] - pref_sum[n - mx]);
    long long rem = m - need;
    if (rem < 0) continue;
    if (mx == n) {
      long long score_here = 1ll * n * cf + A * cm;
      cout << score_here << endl;
      for (int i = 0; i < n; i++) {
        if (i) cout << " ";
        cout << A;
      }
      cout << endl;
      return 0;
    }
    int l, r;
    l = 0;
    r = n - mx;
    while (l < r) {
      int mid = (l + r + 1) / 2;
      if (bal[mid] <= rem)
        l = mid;
      else
        r = mid - 1;
    }
    long long take2 = bal[l];
    long long rem2 = rem - take2;
    long long full_units = rem2 / l;
    long long score_here =
        1ll * cf * mx + 1ll * (skills[l - 1].first + full_units) * cm;
    if (score_here > ans) {
      ans = score_here;
      ans1 = mx;
      ans2 = l;
    }
  }
  cout << ans << endl;
  long long need = 1ll * A * ans1 - (pref_sum[n] - pref_sum[n - ans1]);
  long long rem = m - need;
  long long take2 = bal[ans2];
  long long rem2 = rem - take2;
  long long full_units = rem2 / ans2;
  long long ohead = full_units + skills[ans2 - 1].first;
  for (int i = n - 1; i >= n - ans1; i--) {
    int id = skills[i].second;
    starts[id] = A;
  }
  for (int i = 0; i < ans2; i++) {
    int id = skills[i].second;
    starts[id] = ohead;
  }
  for (int i = 0; i < n; i++) {
    if (i) cout << " ";
    cout << starts[i];
  }
  cout << endl;
  cin.get();
  cin.get();
  return 0;
}
