#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-12;
const double PI = acos(-1);
const long long INFF = (long long)1e18;
const int INF = (int)1e9;
const int mod = (int)1e9 + 7;
const int MAX = (int)1e5 + 7;
int a[MAX];
long long b[MAX];
pair<int, int> c[MAX];
long long pre[MAX];
int main(void) {
  int n, m;
  long long cf, cm, k;
  scanf("%d %d %lld %lld %lld", &n, &m, &cf, &cm, &k);
  for (int i = (1); i < (n + 1); ++i) scanf("%d", a + i);
  for (int i = (1); i < (n + 1); ++i) b[i] = a[i];
  sort(b + 1, b + n + 1);
  for (int i = (1); i < (n + 1); ++i) pre[i] = pre[i - 1] + b[i];
  if ((long long)n * m - pre[n] <= k) {
    printf("%lld\n", cf * n + cm * m);
    for (int i = (1); i < (n + 1); ++i) printf("%d ", m);
    return 0;
  }
  b[n + 1] = m;
  long long sum = 0;
  long long bst = (long long)b[1] * cm;
  pair<int, int> ans = make_pair(n + 1, b[1]);
  for (int i = n + 1; i >= 1; --i) {
    sum += m - b[i];
    if (sum > k) break;
    long long la = k - sum;
    long long l = b[1], r = m, res = b[1];
    while (l <= r) {
      long long mid = (l + r) >> 1;
      int p = upper_bound(b + 1, b + i, mid) - b - 1;
      if (mid * p - pre[p] > la)
        r = mid - 1;
      else
        l = mid + 1, res = mid;
    }
    if (cf * (n + 1 - i) + res * cm > bst) {
      bst = cf * (n + 1 - i) + res * cm;
      ans = make_pair(i, res);
    }
  }
  for (int i = (1); i < (n + 1); ++i) c[i].first = a[i], c[i].second = i;
  sort(c + 1, c + n + 1);
  for (int i = (ans.first); i < (n + 1); ++i) a[c[i].second] = m;
  for (int i = (1); i < (ans.first); ++i) {
    if (c[i].first < ans.second)
      a[c[i].second] = ans.second;
    else
      break;
  }
  printf("%lld\n", bst);
  for (int i = (1); i < (n + 1); ++i) printf("%d ", a[i]);
  return 0;
}
