#include <bits/stdc++.h>
using namespace std;
bool cmp(const pair<long long, int>& a, const pair<long long, int>& b) {
  return a > b;
}
long long n, A, cf, cm, m;
vector<pair<long long, int>> v;
long long suf[123123];
long long maxi, mini;
void relax(long long maxi1, long long mini1) {
  long long ans1 = cf * maxi1 + cm * mini1;
  long long ans = cf * maxi + cm * mini;
  if (ans1 > ans) {
    maxi = maxi1;
    mini = mini1;
  }
}
long long ans[123123];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> A >> cf >> cm >> m;
  int a;
  for (int i = 1; i <= n; ++i) {
    cin >> a;
    v.push_back(make_pair(a, i));
  }
  v.push_back(make_pair(A, n + 1));
  sort(v.begin(), v.end(), cmp);
  for (int i = n; i >= 0; --i) {
    suf[i] = suf[i + 1] + v[i].first;
  }
  long long brakuje = n * A - suf[1];
  if (brakuje <= m) {
    cout << n * cf + A * cm << endl;
    for (int i = 0; i < n; ++i) {
      cout << A << " ";
    }
    cout << endl;
    return 0;
  }
  int j = 1;
  for (int i = 0; i <= n; ++i) {
    j = max(j, i + 1);
    long long cost1 = (i + 1) * A - (suf[0] - suf[i + 1]);
    if (cost1 > m) {
      break;
    }
    long long cost2 = m - cost1;
    while (cost2 < (v[j].first * (n - j) - suf[j + 1])) {
      ++j;
    }
    cost2 -= (v[j].first * (n - j) - suf[j + 1]);
    long long mini2 = v[j].first + (cost2) / (n - j + 1);
    mini2 = min(mini2, A);
    relax(i, mini2);
  }
  long long ansik = cf * maxi + cm * mini;
  for (int i = 1; i <= n; ++i) {
    if (i <= maxi) {
      ans[v[i].second] = A;
      continue;
    }
    ans[v[i].second] = max(v[i].first, mini);
  }
  cout << ansik << endl;
  for (int i = 1; i <= n; ++i) {
    cout << ans[i] << " ";
  }
  cout << endl;
}
