#include <bits/stdc++.h>
using namespace std;
template <class T>
void Read(T& x) {
  x = 0;
  int flag = 0, sgn = 1;
  char c;
  while (c = getchar()) {
    if (c == '-')
      sgn = -1;
    else if (c >= '0' && c <= '9')
      x *= 10, x += c - '0', flag = 1;
    else if (flag)
      break;
  }
  x *= sgn;
}
const int MAXN = 1e5 + 10;
long long n, A, cf, cm, m;
struct Skill {
  long long id, lev, ans;
  Skill(long long id = 0, long long lev = 0, long long ans = 0)
      : id(id), lev(lev), ans(lev) {}
} ski[MAXN];
bool cmp(const Skill& x, const Skill& y) { return x.lev < y.lev; }
bool cmpid(const Skill& x, const Skill& y) { return x.id < y.id; }
long long sum[MAXN], ans = 0, mnn = 0x3f3f3f3f, Mn = 0x3f3f3f3f;
long long buy = n + 1, mn = 0x3f3f3f3f;
long long judge(int k, long long res, bool flag) {
  long long per = k;
  long long tmp = per == 0 ? 0 : res / per;
  mnn = ski[k].lev + tmp;
  long long c = !flag ? ski[k + 1].lev : A;
  if (mnn > c) mnn = c;
  mn = k;
}
int main() {
  int cnt = 0;
  Read(n), Read(A), Read(cf), Read(cm), Read(m);
  for (int i = 1; i <= n; i++) {
    int v;
    Read(v);
    ski[i] = Skill(i, v, 0);
    if (v == A) cnt++;
  }
  ski[n + 1] = Skill(n + 1, A, 0);
  n++;
  cnt++;
  sort(ski + 1, ski + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + ski[i].lev;
  }
  if (ski[1].lev == A) {
    cout << (long long)(n - 1) * cf + A * cm << endl;
    for (int i = 1; i < n; i++) printf("%I64d ", A);
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    int org = i - 1;
    while (i + 1 <= n && ski[i].lev == ski[i + 1].lev) i++;
    long long low = sum[i];
    low = m - (ski[i].lev * i - low);
    if (low < 0 || ski[i].lev >= A) {
      mn = org;
      judge(org, m - (ski[org].lev * mn - sum[org]), 0);
      ans = max(mnn * cm + (cnt - 1) * cf, ans);
      Mn = mnn;
      break;
    }
  }
  mn = min(mn, n - 1);
  int p = n - cnt + 1;
  for (int i = p - 1; i >= 1; i--) {
    int flag = 0;
    m -= (A - ski[i].lev);
    if (m < 0) break;
    while (m - (ski[mn].lev * mn - sum[mn]) < 0) mn--;
    mn = min(mn, (long long)i - 1);
    long long mo = m - (ski[mn].lev * mn - sum[mn]);
    if (mn == i - 1) flag = 1;
    if (mn == 0)
      mnn = A;
    else
      judge(mn, mo, flag);
    if (mnn * cm + (n - i) * cf > ans)
      ans = mnn * cm + (n - i) * cf, p = i, Mn = mnn;
  }
  cout << ans << endl;
  for (int i = n; i >= p; i--) ski[i].ans = A;
  for (int i = 1; i <= n; i++)
    if (ski[i].ans <= Mn) ski[i].ans = Mn;
  sort(ski + 1, ski + 1 + n, cmpid);
  for (int i = 1; i < n; i++) printf("%I64d ", ski[i].ans);
}
