#include <bits/stdc++.h>
using namespace std;
struct qq {
  long long x, m;
  bool operator<(const qq &X) const { return x < X.x; }
} a[100005];
long long b[100005], man;
long long n, m, A, cf, cm, pre[100005], i, sum, ans, temm, L, R, mid, chuang;
int main() {
  scanf("%I64d%I64d%I64d%I64d%I64d", &n, &A, &cf, &cm, &m);
  for (i = 1; i <= n; ++i) {
    scanf("%I64d", &a[i].x);
    a[i].m = i;
  }
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; ++i) pre[i] = a[i].x + pre[i - 1];
  if (m + pre[n] >= A * n) {
    printf("%I64d\n", cf * n + A * cm);
    for (i = 0; i < n; ++i) {
      printf("%I64d%c", A, i == n - 1 ? '\n' : ' ');
    }
    return 0;
  }
  ans = -1;
  for (i = n + 1; i; --i) {
    sum += a[i].x;
    if (m + sum < A * (n - i + 1)) break;
    temm = m - A * (n - i + 1) + sum;
    if (pre[i - 1] + temm >= (i - 1) * a[i - 1].x) {
      if (ans < cf * (n - i + 1) + min(A, (pre[i - 1] + temm) / (i - 1)) * cm) {
        ans = cf * (n - i + 1) + min(A, (pre[i - 1] + temm) / (i - 1)) * cm;
        man = i;
        chuang = min(A, (pre[i - 1] + temm) / (i - 1));
      }
      continue;
    }
    L = 1;
    R = i - 1;
    while (L < R) {
      mid = 1 + ((L + R) >> 1);
      if (pre[mid] + temm >= (mid)*a[mid].x) {
        L = mid;
      } else {
        R = mid - 1;
      }
    }
    if (ans < cf * (n - i + 1) + min(A, (pre[L] + temm) / L) * cm) {
      ans = cf * (n - i + 1) + min(A, (pre[L] + temm) / L) * cm;
      man = i;
      chuang = min(A, (pre[L] + temm) / L);
    }
  }
  for (i = n; i >= man; --i) a[i].x = A;
  for (i = 1; i <= n; ++i) {
    if (a[i].x <= chuang) {
      b[a[i].m] = chuang;
    } else {
      b[a[i].m] = a[i].x;
    }
  }
  printf("%I64d\n", ans);
  for (i = 1; i <= n; ++i) {
    printf("%I64d%c", b[i], i == n ? '\n' : ' ');
  }
  return 0;
}
