#include <bits/stdc++.h>
const double PI = acos(-1.0);
const double e = exp(1.0);
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
inline T Min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
inline T Max(T a, T b) {
  return a > b ? a : b;
}
bool cmpbig(int a, int b) { return a > b; }
bool cmpsmall(int a, int b) { return a < b; }
using namespace std;
using namespace std;
const long long maxn = 2e5;
pair<long long, long long> a[maxn];
long long sum[maxn], b[maxn];
long long n, A, cf, cm, m, i, j, k, ans, p, xx, yy, x;
int main() {
  scanf("%I64d %I64d %I64d %I64d %I64d", &n, &A, &cf, &cm, &m);
  for (i = 1; i <= n; i++) {
    scanf("%I64d", &a[i].first);
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i].first;
  p = n;
  for (i = 0; i <= n; i++) {
    long long d = m - (A * i - (sum[n] - sum[n - i]));
    if (d < 0) break;
    p = min(p, n - i);
    if (p == 0) {
      x = cf * i + cm * A;
      k = A;
    } else {
      while (d < a[p].first * (p - 1) - sum[p - 1]) p--;
      d -= a[p].first * (p - 1) - sum[p - 1];
      k = min(a[p].first + d / p, A);
      x = cf * i + cm * k;
    }
    if (ans < x) {
      ans = x;
      xx = i;
      yy = k;
    }
  }
  printf("%I64d\n", ans);
  for (i = n - xx + 1; i <= n; i++) b[a[i].second] = A;
  for (i = 1; i <= n - xx; i++) b[a[i].second] = max(a[i].first, yy);
  for (i = 1; i <= n; i++) printf("%I64d ", b[i]);
  printf("\n");
  return 0;
}
