#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 100;
long long n, A, Cf, Cm, m;
struct node {
  int line;
  long long num;
};
node a[100001];
long long sum[100001];
bool cmp(node a, node b) { return a.num < b.num; }
bool cmp1(node a, node b) { return a.line < b.line; }
int main() {
  while (cin >> n >> A >> Cf >> Cm >> m) {
    long long gao = m;
    sum[0] = 0;
    for (int i = 1; i <= n; ++i) {
      scanf("%d", &a[i].num);
      a[i].line = i;
    }
    sort(a + 1, a + n + 1, cmp);
    for (int i = 1; i <= n; ++i) sum[i] = sum[i - 1] + a[i].num;
    long long ans = -1;
    int pos = -1;
    long long mixx = -1;
    for (int i = n; i > 0; --i) {
      long long cnt = A * (n - i) - (sum[n] - sum[i]);
      if (cnt > m) break;
      int l = 1, r = i + 1;
      long long total = 0;
      while (r - l > 1) {
        int mid = (r + l) / 2;
        total = mid * a[mid].num - sum[mid];
        if (total <= m - cnt)
          l = mid;
        else
          r = mid;
      }
      long long add = (m - cnt - (l * a[l].num - sum[l])) / l;
      if (ans < min(A - 1, (a[l].num + add)) * Cm + (n - i) * Cf) {
        ans = min(A - 1, (a[l].num + add)) * Cm + (n - i) * Cf;
        pos = l;
        mixx = min(A - 1, (a[l].num + add));
      }
    }
    if (A * n - sum[n] <= m) {
      ans = n * Cf + A * Cm;
      pos = n;
      mixx = A;
    }
    for (int i = 1; i <= pos; i++) gao -= (mixx - a[i].num), a[i].num = mixx;
    for (int i = n; i >= 1; i--) {
      if (gao - (A - a[i].num) < 0)
        break;
      else
        gao -= (A - a[i].num), a[i].num = A;
    }
    cout << ans << endl;
    sort(a + 1, a + n + 1, cmp1);
    for (int i = 1; i <= n; i++) {
      if (i != 1) printf(" ");
      printf("%I64d", a[i].num);
    }
    printf("\n");
  }
  return 0;
}
