#include <bits/stdc++.h>
using namespace std;
long long n, A, cf, cm, m, ans, Ac, Mc, Dc, Acost;
int s[100005];
struct Node {
  int c, p;
  Node(int c = 0, int p = 0) : c(c), p(p) {}
} a[100005];
bool cmp(Node a, Node b) { return a.c < b.c; }
long long sum[100005];
bool C(int i, long long j) {
  long long mbak = m - Acost;
  long long need = lower_bound(a + 1, a + 1 + n, Node(j, 0), cmp) - a - 1;
  if (need > n - i) {
    long long g = need - (n - i);
    mbak += (j * g) - (sum[need] - sum[n - i]);
  }
  long long Bcost = (need * j) - sum[need];
  if (mbak >= Bcost) {
    long long d = cf * i + cm * j;
    if (ans < d) {
      Ac = i;
      ans = d;
      Mc = need;
      Dc = j;
    }
    return true;
  } else
    return false;
}
int main() {
  scanf("%lld %lld %lld %lld %lld", &n, &A, &cf, &cm, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].c);
    s[i] = a[i].c;
    a[i].p = i;
  }
  sort(a + 1, a + 1 + n, cmp);
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i].c;
  for (int i = 0; i <= n; i++) {
    Acost = A * i - (sum[n] - sum[n - i]);
    if (m >= Acost) {
      long long l = a[1].c - 1, r = A;
      while (l < r) {
        long long mid = (l + r + 1) / 2;
        if (C(i, mid))
          l = mid;
        else
          r = mid - 1;
      }
    } else
      break;
    long long d = cf * i;
    if (ans < d) {
      Ac = i;
      ans = d;
      Mc = 0;
      Dc = 0;
    }
  }
  printf("%lld\n", ans);
  for (int i = 1; i <= Mc; i++) {
    s[a[i].p] = Dc;
  }
  for (int i = n; i > n - Ac; i--) {
    s[a[i].p] = A;
  }
  for (int i = 1; i <= n; i++) printf("%d ", s[i]);
}
