#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int maxint = 0x3f3f3f3f;
const int mod = 1e9 + 7;
struct mmp {
  long long x, y;
} f[maxn];
long long n, a, cf, cm, m;
long long s[maxn], sum, ans, ma, ret, g[maxn];
long long erfen(long long h, long long y) {
  long long l = 0, r = y, mid;
  while (l <= r) {
    mid = (l + r) / 2;
    if (f[mid].x < h)
      l = mid + 1;
    else
      r = mid - 1;
  }
  if (r * h - s[r] <= m)
    return 1;
  else
    return 0;
}
long long jisuan(long long x, long long y) {
  long long l = f[1].x, r = a, h;
  while (l <= r) {
    h = (l + r) / 2;
    if (erfen(h, y))
      l = h + 1;
    else
      r = h - 1;
  }
  return r;
}
bool cmp1(mmp x, mmp y) { return x.x < y.x; }
int main() {
  long long i, j, k;
  cin >> n >> a >> cf >> cm >> m;
  for (i = 1; i <= n; i++) {
    scanf("%I64d", &f[i].x);
    f[i].y = i;
  }
  sort(f + 1, f + n + 1, cmp1);
  for (i = 1; i <= n; i++) {
    s[i] = s[i - 1] + f[i].x;
  }
  for (i = n; i >= 0; i--) {
    ret = jisuan(m, i);
    if (ans + ret * cm >= ma) {
      ma = max(ma, ans + ret * cm);
      j = i;
      k = ret;
    }
    if (a - f[i].x > m) break;
    m -= a - f[i].x;
    ans += cf;
  }
  cout << ma + sum << "\n";
  for (i = 1; i <= j; i++) {
    if (f[i].x < k)
      g[f[i].y] = k;
    else
      g[f[i].y] = f[i].x;
  }
  for (i = j + 1; i <= n; i++) {
    g[f[i].y] = a;
  }
  for (i = 1; i < n; i++) {
    printf("%I64d ", g[i]);
  }
  cout << g[n] << "\n";
  return 0;
}
