#include <bits/stdc++.h>
using namespace std;
FILE *in;
FILE *out;
const int MAX = 131072;
struct Skill {
  int idx;
  long long val;
  bool operator<(const Skill &r) const {
    return val != r.val ? val < r.val : idx < r.idx;
  }
};
int n;
Skill a[MAX];
long long cf, cm, m, A;
long long need[MAX];
void solve() {
  sort(a, a + n);
  need[0] = 0;
  for (int i = 1; i < n; i++) {
    need[i] = need[i - 1] + i * (a[i].val - a[i - 1].val);
  }
  int idx = 0, with = n;
  while (idx < n && need[idx] <= m) idx++;
  idx--;
  long long upto = min(A, a[idx].val + (m - need[idx]) / (idx + 1));
  long long best = cm * upto;
  long long rem = m;
  for (int i = n - 1; i >= 0; i--) {
    rem -= (A - a[i].val);
    if (rem < 0) break;
    while (idx >= i) idx--;
    while (idx >= 0 && need[idx] > rem) idx--;
    long long minVal =
        idx < 0 ? A : (a[idx].val + (rem - need[idx]) / (idx + 1));
    minVal = min(minVal, A);
    long long cur = cf * (n - i) + cm * minVal;
    if (best < cur) {
      best = cur, with = i, upto = minVal;
    }
  }
  for (int i = n - 1; i >= with; i--) a[i].val = A;
  for (int i = 0; i < n; i++) a[i].val = max(a[i].val, upto);
  cout << best << endl;
  static int ans[MAX];
  for (int i = 0; i < n; i++) ans[a[i].idx] = a[i].val;
  for (int i = 0; i < n; i++)
    fprintf(out, "%d%c", ans[i], i + 1 == n ? '\n' : ' ');
}
int main(void) {
  in = stdin;
  out = stdout;
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 0; i < n; i++) {
    int tmp;
    fscanf(in, "%d", &tmp);
    a[i].idx = i;
    a[i].val = tmp;
  }
  solve();
  return 0;
}
