#include <bits/stdc++.h>
using namespace std;
long long n, A, cf, cm, m;
long long a[100001], id[100001], t[100001];
class min_level_optimizer {
 public:
  long long cur_pos;
  long long cur_min;
  long long money_left;
  void init() {
    cur_pos = 1;
    cur_min = a[id[1]];
    money_left = 0;
  }
  long long update(long long extra_money, long long limit) {
    money_left += extra_money;
    while (cur_pos < min(limit, n) &&
           cur_pos * (a[id[cur_pos + 1]] - cur_min) <= money_left) {
      money_left -= cur_pos * (a[id[cur_pos + 1]] - cur_min);
      cur_min = a[id[++cur_pos]];
    }
    return cur_min + money_left / cur_pos;
  }
} op;
long long force(long long perfected, long long min_level) {
  return perfected * cf + min_level * cm;
}
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  scanf("%lld%lld%lld%lld%lld", &n, &A, &cf, &cm, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    id[i] = i;
  }
  sort(id + 1, id + n + 1, cmp);
  op.init();
  long long start_pos = n + 1;
  long long money_need = 0;
  while (start_pos > 1 && money_need + A - a[id[start_pos - 1]] <= m) {
    money_need += A - a[id[--start_pos]];
  }
  if (start_pos == 1) {
    printf("%lld\n", force(n, A));
    for (int i = 1; i <= n; i++) {
      printf("%lld ", A);
    }
  } else {
    long long best_perfected = n + 1 - start_pos;
    long long best_min_level = op.update(m - money_need, start_pos - 1);
    long long ans = force(best_perfected, best_min_level);
    while (start_pos <= n) {
      start_pos++;
      long long new_min_level =
          op.update(A - a[id[start_pos - 1]], start_pos - 1);
      if (force(n + 1 - start_pos, new_min_level) > ans) {
        best_perfected = n + 1 - start_pos;
        best_min_level = new_min_level;
        ans = force(best_perfected, best_min_level);
      }
    }
    printf("%lld\n", ans);
    for (int i = 1; i <= n; i++) {
      t[id[i]] =
          ((i > n - best_perfected) ? (A) : (max(best_min_level, a[id[i]])));
    }
    for (int i = 1; i <= n; i++) {
      printf("%lld ", t[i]);
    }
  }
  return 0;
}
