#include <bits/stdc++.h>
using namespace std;
class A {
 public:
  void solve() {
    long long l, r, k;
    cin >> l >> r >> k;
    long long ans = 1;
    vector<long long> res;
    while (ans <= r) {
      if (ans >= l) res.push_back(ans);
      if (ans > r / k) break;
      ans *= k;
    }
    if (res.empty())
      cout << -1 << '\n';
    else {
      for (long long i : res) cout << i << ' ';
      cout << '\n';
    }
  }
};
class B {
 public:
  void solve() {
    int n;
    cin >> n;
    vector<string> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    auto check = [](string x) {
      int one = 0;
      int len = 0;
      for (int i = x.size() - 1; i >= 0; i--) {
        len++;
        if (x[i] == '1')
          one++;
        else if (x[i] != '0')
          return -1;
        if (one > 1) return -1;
      }
      return (int)x.size();
    };
    int cnt = 0;
    bool one = true;
    for (auto i : a) {
      if (i[0] == '0') {
        cout << 0 << '\n';
        return;
      }
    }
    for (auto i : a) {
      int temp = check(i);
      if (temp == -1) {
        assert(one);
        one = false;
        cout << i;
      } else {
        cnt += temp - 1;
      }
    }
    if (one) cout << 1;
    for (int i = 0; i < cnt; i++) cout << 0;
    cout << '\n';
  }
};
class D {
 public:
  void solve() {
    long long n, A, cf, cm, m;
    cin >> n >> A >> cf >> cm >> m;
    vector<long long> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    long long ans = 0;
    vector<pair<long long, long long> > seq;
    for (int i = 0; i < n; i++) {
      seq.emplace_back(a[i], i);
    }
    sort(seq.begin(), seq.end(),
         [](const pair<long long, long long> &a,
            const pair<long long, long long> &b) {
           if (a.first != b.first) return a.first > b.first;
           return a.second < b.second;
         });
    vector<long long> sum(n + 1, 0);
    for (int i = 0; i < n; i++) {
      sum[i + 1] = sum[i] + A - seq[i].first;
    }
    vector<long long> rsum(n + 1, 0);
    for (int i = n - 1; i >= 1; i--) {
      rsum[i] += rsum[i + 1] + (seq[i - 1].first - seq[i].first) * (n - i);
    }
    auto check = [&seq, &n, &A, &rsum](long long x, long long cost) {
      if (x >= n + 1) return -1ll;
      long long l = x, r = n;
      long long ans = -1;
      while (l <= r) {
        long long mid = l + (r - l) / 2;
        if (rsum[mid] <= cost) {
          ans = mid;
          r = mid - 1;
        } else
          l = mid + 1;
      }
      return min(A, seq[ans - 1].first + (cost - rsum[ans]) / (n - ans + 1));
    };
    long long l = 0, mi = 0;
    for (long long i = 0; i <= n && sum[i] <= m; i++) {
      long long left = m - sum[i];
      long long temp = check(i + 1, left);
      long long cur = i * cf;
      if (temp == -1)
        cur += A * cm;
      else
        cur += temp * cm;
      if (cur > ans) {
        ans = cur;
        l = i;
        mi = temp;
      }
    }
    for (int i = 0; i < l; i++) a[seq[i].second] = A;
    m -= sum[l];
    for (int i = n - 1; i >= 0 && seq[i].first < mi && m > 0; i--) {
      if (m < mi - seq[i].first) break;
      m -= mi - seq[i].first;
      a[seq[i].second] = mi;
    }
    cout << ans << '\n';
    for (auto i : a) cout << i << ' ';
    cout << '\n';
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  D ans;
  ans.solve();
  return 0;
}
