#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
struct node {
  int id;
  long long val;
  node(long long val = 0, int id = 0) : val(val), id(id) {}
} a[maxn];
long long preS[maxn], n, A, cf, cm, m;
;
bool cmp1(node a, node b) {
  if (a.val != b.val)
    return a.val < b.val;
  else
    return a.id < b.id;
}
bool cmp2(node a, node b) { return a.id < b.id; }
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> A >> cf >> cm >> m;
  for (int i = 1; i <= n; i++) cin >> a[i].val, a[i].id = i;
  sort(a + 1, a + n + 1, cmp1);
  preS[0] = 0;
  for (int i = 1; i <= n; i++) preS[i] = preS[i - 1] + a[i].val;
  long long R = n;
  long long ret = 0, l1 = 0, r1 = 0;
  for (long long i = 0; i <= n; i++) {
    long long lft = m - i * A + preS[n] - preS[n - i];
    if (lft < 0) break;
    R = min(R, n - i);
    while (R > 0 && lft < R * a[R].val - preS[R]) R--;
    lft -= R * a[R].val - preS[R];
    long long d = min(A, i == n ? A : a[R].val + lft / R);
    if (ret < d * cm + i * cf) {
      ret = d * cm + i * cf;
      l1 = i;
      r1 = d;
    }
  }
  for (int i = 0; i < l1; i++) {
    a[n - i].val = A;
  }
  for (int i = 1; i <= n; i++) {
    a[i].val = max(a[i].val, r1);
  }
  sort(a + 1, a + n + 1, cmp2);
  cout << ret << endl;
  cout << a[1].val;
  for (int i = 2; i <= n; i++) {
    cout << " " << a[i].val;
  }
  cout << endl;
}
