#include <bits/stdc++.h>
using namespace std;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long lcm(long long a, long long b) { return (a * (b / gcd(a, b))); }
bool in_range(int i, int j, int n, int m) {
  return i >= 0 && i < n && j >= 0 && j < m;
}
long long n, A, c1, c2, m;
long long a[100100], b[100100], dp[100100];
void solution() {
  scanf("%I64d%I64d", &(n), &(A));
  scanf("%I64d%I64d", &(c1), &(c2));
  scanf("%I64d", &(m));
  long long temp = 0, cnt = 0;
  for (int i = 0; i < int(n); i++)
    scanf("%I64d", &(a[i])), b[i] = a[i], temp += A - a[i], cnt += a[i] == A;
  if (temp <= m) {
    printf("%I64d\n", n * c1 + A * c2);
    for (int i = 0; i < int(n); i++) printf("%I64d ", A);
    return;
  }
  sort(a, a + n);
  dp[0] = 0;
  for (int i = int(1); i < int(n); i++)
    dp[i] = dp[i - 1] + (a[i] - a[i - 1]) * i;
  reverse(a, a + n);
  long long num = 0, mn, res, t, mini;
  long long* it = lower_bound(dp, dp + n, m);
  if (it != dp) it--;
  mn = a[n - 1 - (it - dp)];
  temp = m - *it;
  mn += temp / (it - dp + 1);
  res = cnt * c1 + mn * c2;
  map<long long, int> mm, op;
  for (int i = 0; i < int(n); i++) {
    if (A - a[i] > m) break;
    m -= A - a[i];
    num++;
    mm[a[i]]++;
    it = lower_bound(dp, dp + n - i - 1, m);
    if (it != dp) it--;
    mini = a[n - 1 - (it - dp)];
    temp = m - *it;
    mini += temp / (it - dp + 1);
    t = num * c1 + mini * c2;
    if (t > res) {
      res = t;
      cnt = num;
      mn = mini;
      op = mm;
    }
  }
  printf("%I64d\n", res);
  for (int i = 0; i < int(n); i++) {
    if (op.find(b[i]) != op.end() && op[b[i]]) {
      printf("%I64d ", A);
      op[b[i]]--;
    } else if (b[i] < mn)
      printf("%I64d ", mn);
    else
      printf("%I64d ", b[i]);
  }
}
int main() {
  double beg = clock();
  solution();
  return 0;
}
