#include <bits/stdc++.h>
using namespace std;
int n;
long long A, cf, cm;
long long m;
long long a[100010];
long long c[100010];
long long ans;
pair<long long, int> p[100010];
long long x[100010];
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    x[i] = a[i];
    p[i] = make_pair(a[i], i);
  }
  sort(a + 1, a + 1 + n);
  sort(p + 1, p + 1 + n);
  for (int i = 2; i <= n; i++) {
    c[i] = c[i - 1] + (i - 1) * (a[i] - a[i - 1]);
  }
  int besti, bestk;
  long long besth;
  for (int i = 0, j = n; i <= n; i++) {
    if (m < 0) break;
    while (c[j] > m) j--;
    long long cur = cf * i;
    int k = min(j, n - i);
    long long minh;
    if (k > 0) {
      long long mm = m;
      mm -= c[k];
      minh = min(A, a[k] + mm / k);
      cur += cm * minh;
    }
    if (i == n) cur += cm * A;
    if (cur > ans) {
      ans = cur;
      besti = i;
      bestk = k;
      besth = minh;
    }
    m -= A - a[n - i];
  }
  for (int i = 0; i < besti; i++) {
    int idx = p[n - i].second;
    x[idx] = A;
  }
  for (int i = 0; i < bestk; i++) {
    int idx = p[i + 1].second;
    x[idx] = besth;
  }
  cout << ans << '\n';
  for (int i = 1; i <= n; i++) cout << x[i] << ' ';
}
