#include <bits/stdc++.h>
using namespace std;
long long n, m, V1, V2, MXA;
long long num, number, ans = -1;
long long l, r, mid, l_ = 0, r_ = 0;
long long sum[100050];
long long b[100050];
long long ans_[100050];
struct dist {
  long long v, id;
} a[100050];
inline long long read() {
  long long s = 0, t = 1;
  char c;
  while (c < '0' || c > '9') {
    if (c == '-') t = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    s = s * 10 + c - '0';
    c = getchar();
  }
  return s * t;
}
inline bool check(long long mid, long long num, long long mx) {
  long long _l = 1, _r = mx, mid2 = 0;
  while (_l <= _r) {
    mid2 = (_l + _r) >> 1;
    if (a[mid2].v <= mid)
      _l = mid2 + 1;
    else
      _r = mid2 - 1;
  }
  if ((long long)(num - _r * mid + sum[_r]) >= 0) {
    return true;
  }
  return false;
}
inline bool cmp(dist p, dist q) { return p.v < q.v; }
int main() {
  long long p = 0;
  n = read();
  MXA = read();
  V1 = read();
  V2 = read();
  m = read();
  for (int i = 1; i <= n; i++) {
    a[i].v = read();
    a[i].id = i;
  }
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i].v;
  for (int i = 0; i <= n; i++) {
    l = 0;
    r = MXA;
    num = m - (long long)(i * MXA) + (sum[n] - sum[n - i]);
    if (num < 0) break;
    while (l <= r) {
      mid = (l + r) >> 1;
      if (check(mid, num, n - i))
        l = mid + 1;
      else
        r = mid - 1;
    }
    number = (long long)(i * V1) + (long long)(r * V2);
    if (number > ans) {
      ans = number;
      l_ = i;
      r_ = r;
    }
  }
  for (int i = 1; i <= n; i++)
    if (n - l_ < i)
      ans_[a[i].id] = MXA;
    else if (a[i].v <= r_)
      ans_[a[i].id] = r_;
    else
      ans_[a[i].id] = a[i].v;
  printf("%lld ", ans);
  cout << endl;
  for (int i = 1; i <= n; i++) printf("%d ", ans_[i]);
  return 0;
}
