#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)1e5 + 5;
struct skill {
  long long val;
  long long index;
  skill() : val(0), index(0) {}
  skill(long long _val, long long _index) : val(_val), index(_index) {}
};
long long ans = 0;
long long n, A, cf, cm, m;
long long R[MAXN];
skill a[MAXN];
bool cmp1(skill a, skill b) { return a.val < b.val; }
bool cmp2(skill a, skill b) { return a.index < b.index; }
long long maximize(int k, long long val) {
  int l = 0, r = k;
  while (l < r) {
    int mid = l + (r - l) / 2;
    if (val < R[mid]) {
      r = mid;
    } else {
      l = mid + 1;
    }
  }
  int index = l - 1;
  int leftover = val - R[index];
  long long minVal = a[index].val + leftover / (index + 1);
  minVal = min(minVal, A);
  return index;
}
int main() {
  scanf("%I64d%I64d%I64d%I64d%I64d", &n, &A, &cf, &cm, &m);
  for (int i = 0; i < n; i++) {
    a[i].index = i;
    scanf("%I64d", &a[i].val);
  }
  sort(a, a + n, cmp1);
  R[0] = 0;
  for (int i = 1; i < n; i++) {
    R[i] = R[i - 1] + i * (a[i].val - a[i - 1].val);
  }
  long long skillsMaxed = 0, minIndex = -1, minValueKeep = 0;
  long long ans = a[0].val * cm;
  for (int i = 0; i < n; i++) {
    if (a[i].val == A) {
      ans += cf;
    }
  }
  for (int i = 0; i <= n; i++) {
    if (i != 0) {
      m -= (A - a[n - i].val);
    }
    if (m <= 0) {
      break;
    }
    long long af = i * cf;
    long long am, minVal, index, leftover;
    if (i == n) {
      am = A * cm;
    } else {
      int l = 0, r = n - i;
      while (l < r) {
        int mid = l + (r - l) / 2;
        if (m < R[mid]) {
          r = mid;
        } else {
          l = mid + 1;
        }
      }
      index = l - 1;
      leftover = m - R[index];
      minVal = a[index].val + leftover / (index + 1);
      minVal = min(minVal, A);
      am = minVal * cm;
    }
    if (ans < am + af) {
      ans = am + af;
      skillsMaxed = i;
      minIndex = index;
      minValueKeep = minVal;
    }
  }
  for (int i = 0; i < skillsMaxed; i++) {
    a[n - i - 1].val = A;
  }
  for (int i = 0; i <= minIndex; i++) {
    a[i].val = minValueKeep;
  }
  sort(a, a + n, cmp2);
  printf("%I64d\n", ans);
  for (int i = 0; i < n; i++) {
    printf("%I64d%c", a[i].val, i == n - 1 ? '\n' : ' ');
  }
  return 0;
}
