#include <bits/stdc++.h>
using namespace std;
struct node {
  int lev, num;
} a[100010];
int out[100010];
long long sum[100010], m;
bool cmp(node a, node b) { return a.lev < b.lev; }
int main() {
  int n, A, cf, cm;
  int x, y, z;
  long long ans;
  scanf("%d%d%d%d%I64d", &n, &A, &cf, &cm, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].lev);
    a[i].num = i;
  }
  sort(a + 1, a + n + 1, cmp);
  sum[0] = 0;
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + 1ll * a[i].lev;
  ans = -1;
  for (int i = 0; i <= n; i++) {
    long long rest = m - 1ll * i * A + sum[n] - sum[n - i];
    if (rest < 0) continue;
    if (i == n) {
      ans = 1ll * cf * n + 1ll * cm * A;
      x = 0;
      y = 0;
      z = n;
      continue;
    }
    int l = 1, r = n - i + 1, mid;
    while (l < r - 1) {
      mid = (l + r) >> 1;
      if (1ll * a[mid].lev * mid - sum[mid] <= rest)
        l = mid;
      else
        r = mid;
    }
    long long k1, k2, t;
    k1 = 1ll * i * cf;
    t = 1ll * a[l].lev + (rest - (1ll * a[l].lev * l - sum[l])) / l;
    k2 = 1ll * (t > A ? A : t) * cm;
    if (k1 + k2 > ans) {
      x = l;
      y = t > A ? A : t;
      z = i;
      ans = k1 + k2;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i <= x)
      out[a[i].num] = y;
    else if (i > n - z)
      out[a[i].num] = A;
    else
      out[a[i].num] = a[i].lev;
  }
  printf("%I64d\n", ans);
  for (int i = 1; i <= n; i++) printf("%d ", out[i]);
  return 0;
}
