#include <bits/stdc++.h>
using namespace std;
long long X, Y, m, k[200000], res, p, aa, d, A, v2;
int n, v1, z[200000], ll, rr, tt, j;
pair<long long, int> a[200000];
bool cmp(pair<long long, int> i, pair<int, int> j) {
  return (i.first > j.first || (i.first == j.first && i.second < j.second));
}
long long min(long long a, long long b) { return a < b ? a : b; }
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> A >> X >> Y >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a, a + n, cmp);
  res = 0;
  memset(k, 0, sizeof k);
  for (int i = n - 1; i >= 0; i--) k[i] = k[i + 1] + a[i].first;
  res = 0;
  j = 0;
  for (int i = 0; i <= n; i++) {
    j = max(j, i);
    if (j < n) {
      for (j = j; j < n; j++) {
        p = a[j].first * (n - j) - k[j];
        if (p <= m) {
          break;
        }
      }
      d = min(A, a[j].first + (m - p) / (n - j));
    } else
      d = A;
    if (X * i + Y * d > res) {
      res = X * i + Y * d;
      v1 = i;
      v2 = d;
    }
    m -= (A - a[i].first);
    if (m < 0) break;
  }
  for (int i = 0; i < v1; i++) a[i].first = A;
  for (int i = 0; i < n; i++)
    if (a[i].first < v2) a[i].first = v2;
  for (int i = 0; i < n; i++) z[a[i].second] = i;
  cout << res << "\n";
  for (int i = 0; i < n; i++) cout << a[z[i]].first << " ";
}
