#include <bits/stdc++.h>
using namespace std;
int n, cf, cm;
int A;
int data[100000 + 3];
pair<int, int> values[100000 + 3];
long long sum[100000 + 3 + 1];
long long get(int l, int r, int val) {
  return 1LL * (r - l) * val - (sum[r] - sum[l]);
}
long long get_min(int l, int r, long long money) {
  int le = 0, ri = A + 1;
  while (ri > le + 1) {
    int mid = (le + ri) / 2;
    int pos = lower_bound(data + l, data + r, mid) - data;
    if (get(l, pos, mid) <= money) {
      le = mid;
    } else {
      ri = mid;
    }
  }
  return le;
}
int ans[100000 + 3];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long m;
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 0; i < n; i++) {
    cin >> values[i].first;
    values[i].second = i;
  }
  sort(values, values + n);
  for (int i = 1; i <= n; i++) {
    data[i - 1] = values[i - 1].first;
    sum[i] = sum[i - 1] + data[i - 1];
  }
  long long res = -1;
  int best = -1;
  long long need = 0LL;
  int overall_min_value = 0LL;
  long long tmp_ans = 0LL;
  for (int i = n; i >= 0; i--) {
    need = get(i, n, A);
    if (m >= need) {
      overall_min_value = get_min(0, i, m - need);
      tmp_ans = 1LL * (n - i) * cf + 1LL * (overall_min_value)*cm;
      if (tmp_ans > res) {
        res = tmp_ans;
        best = i;
      }
    }
  }
  need = get(best, n, A);
  overall_min_value = get_min(0, best, m - need);
  for (int i = 0; i < n; i++) {
    ans[values[i].second] = max(values[i].first, overall_min_value);
  }
  for (int i = best; i < n; i++) {
    ans[values[i].second] = A;
  }
  cout << res << endl;
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
  cout << "\n";
  return 0;
}
