#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
bool ckmin(T &a, const U &b) {
  return b < a ? a = b, true : false;
}
template <typename T, typename U>
bool ckmax(T &a, const U &b) {
  return b > a ? a = b, true : false;
}
long long n, A, cf, cm, m, res = 0;
vector<array<long long, 2>> a;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> A >> cm >> cf >> m;
  a.assign(n, array<long long, 2>());
  for (int i = 0; i < n; ++i) {
    cin >> a[i][0];
    a[i][1] = i;
  }
  long long chk = 0;
  for (auto i : a) chk += A - i[0];
  if (chk <= m) {
    cout << cf * A + cm * n << "\n";
    for (auto i : a) cout << A << " ";
    return 0;
  }
  sort(a.begin(), a.end(),
       [](const array<long long, 2> &x, const array<long long, 2> &y) {
         return x[0] > y[0];
       });
  long long cur = 0, idx = -1;
  for (int i = 0; i < n; ++i) {
    if (cur + A - a[i][0] <= m) {
      cur += A - a[i][0];
      idx = i;
    } else
      break;
  }
  long long cnt = 1, pos = n - 1, mn = a[n - 1][0], num = idx + 1, ex;
  for (int i = n - 2; i > idx; --i) {
    if ((a[i][0] - mn) * cnt <= m - cur) {
      cur += cnt * (a[i][0] - mn);
      mn = a[i][0];
      ++cnt;
      pos = i;
    }
  }
  mn += (m - cur) / cnt;
  cur += ((m - cur) / cnt) * cnt;
  ex = mn;
  ckmax(res, mn * cf + (idx + 1) * cm);
  for (int i = idx; i >= 0; --i) {
    cur -= A - a[i][0];
    while (pos > i) {
      if ((a[pos - 1][0] - mn) * cnt <= m - cur) {
        cur += cnt * (a[pos - 1][0] - mn);
        mn = a[pos - 1][0];
        ++cnt;
        --pos;
      } else
        break;
    }
    mn += (m - cur) / cnt;
    cur += ((m - cur) / cnt) * cnt;
    if (res < mn * cf + i * cm) {
      res = mn * cf + i * cm;
      num = i, ex = mn;
    }
  }
  cout << res << "\n";
  vector<long long> ans(n, 0);
  for (int i = 0; i < num; ++i) {
    ans[a[i][1]] = A;
  }
  for (int i = num; i < n; ++i) {
    ans[a[i][1]] = max(ex, a[i][0]);
  }
  for (auto i : ans) cout << i << " ";
  return 0;
}
