#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.141592653589793238L;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
long long n, m, A, a[100001], cf, cm;
long long dp[100011];
bool check(long long mid, long long mm, int x) {
  int y = lower_bound(a, a + x + 1, mid) - a;
  --y;
  return mm >= mid * (long long)y - dp[y];
}
long long f(int x, long long mm) {
  long long l = 1, r = A, mid, res = 1;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid, mm, x)) {
      res = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  return res;
}
vector<pair<long long, long long> > v(1, pair<long long, long long>(-1, 0));
bool cmp(const pair<long long, long long> &ob1,
         const pair<long long, long long> &ob2) {
  return ob1.second < ob2.second;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 1; i < n + 1; i++) cin >> a[i], v.push_back(make_pair(a[i], i));
  sort(v.begin(), v.end());
  sort(a, a + n + 1);
  dp[0] = 0;
  for (int i = 1; i < n + 1; i++) dp[i] = a[i] + dp[i - 1];
  long long res = -1, mx = 0, mn = 0;
  long long temp = cm * f(n, m);
  if (res < temp) {
    res = temp;
    mx = 0;
    mn = f(n, m);
  }
  for (int i = 0; i < n + 1; i++) {
    long long temp = 0;
    if (m >= A * (long long)i - (dp[n] - dp[n - i])) {
      long long mm = m - (A * (long long)i - (dp[n] - dp[n - i]));
      temp += (long long)i * cf;
      temp += cm * f(n - i, mm);
      if (res < temp) {
        res = temp;
        mx = i;
        mn = f(n - i, mm);
      }
    } else {
      break;
    }
  }
  cout << res << endl;
  for (int i = 1; i < n + 1; i++) v[i].first = max(v[i].first, mn);
  int i = n;
  while (mx--) v[i--].first = A;
  sort(v.begin(), v.end(), cmp);
  for (int i = 1; i < n + 1; i++) cout << v[i].first << " ";
  return 0;
}
