#include <bits/stdc++.h>
using namespace std;
long long B[2000001];
long long req[2000001];
long long A[2000001];
int main() {
  long long n, a, cf, cm, m;
  cin >> n >> a >> cf >> cm >> m;
  vector<pair<long long, long long> > v;
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &A[i]);
    B[i] = A[i];
    v.push_back(make_pair(A[i], i));
  }
  sort(v.begin(), v.end());
  sort(A + 1, A + n + 1);
  req[1] = 0;
  for (long long i = 2; i <= n; i++) {
    req[i] = req[i - 1] + (i - 1) * (A[i] - A[i - 1]);
  }
  long long c = 0, mx = 0, xx = n + 2, yy = 0, pp = 0;
  for (long long i = n + 1; i >= 1; i--) {
    if (i == 1) {
      if (a - A[i] > m) {
        continue;
      }
      long long ans = a * cm + (n)*cf;
      if (ans > mx) {
        xx = 1;
        mx = ans;
      }
      continue;
    }
    if (i == (n + 1)) {
      long long x = upper_bound(req + 1, req + i, m) - req - 1;
      long long p = A[x];
      long long q = (m - req[x]);
      p += (q / x);
      p = min(a, p);
      long long ans = p * cm;
      if (ans > mx) {
        xx = i;
        yy = x;
        pp = p;
        mx = ans;
      }
      continue;
    }
    if (a - A[i] <= m) {
      m -= (a - A[i]);
      long long x = upper_bound(req + 1, req + i, m) - req - 1;
      long long p = A[x];
      long long q = (m - req[x]);
      p += (q / x);
      p = min(a, p);
      long long ans = p * cm + (n - i + 1) * cf;
      if (ans > mx) {
        xx = i;
        yy = x;
        pp = p;
        mx = ans;
      }
    } else {
      break;
    }
  }
  long long s = 0;
  for (long long i = n - 1; i >= xx - 1; i--) {
    long long c = v[i].second;
    B[c] = a;
  }
  for (long long i = 0; i < yy; i++) {
    long long c = v[i].second;
    B[c] = pp;
  }
  cout << mx << endl;
  for (long long i = 1; i <= n; i++) cout << B[i] << " ";
  printf("\n");
}
