#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100000;
int n, A, cf, cm;
long long M;
long long skill[Maxn + 5];
long long sum[Maxn + 5];
int opt[Maxn + 5];
struct Node {
  int idx;
  int val;
};
Node ipt[Maxn + 5];
inline bool cmp(Node a, Node b) { return a.val > b.val; }
inline bool check(int bg, int ed, int lev, long long pts) {
  int left = bg, right = ed, ans = ed + 1;
  while (left <= right) {
    int mid = (left + right) / 2;
    if (skill[mid] < lev) {
      ans = min(mid, ans);
      right = mid - 1;
    } else
      left = mid + 1;
  }
  if (ans > ed) return true;
  return ((long long)lev * (ed - ans + 1LL) - (sum[ed] - sum[ans - 1])) <= pts;
}
long long Ans = 0;
int AnsFull, AnsLevel;
inline void solve(int bg, int ed, long long pts) {
  int left = 0, right = A, ans = 0;
  while (left <= right) {
    int mid = (left + right) / 2;
    if (check(bg, ed, mid, pts)) {
      ans = max(ans, mid);
      left = mid + 1;
    } else
      right = mid - 1;
  }
  if ((long long)(bg - 1) * cf + (long long)ans * cm > Ans) {
    Ans = (long long)(bg - 1) * cf + (long long)ans * cm;
    AnsFull = bg - 1;
    AnsLevel = ans;
  }
}
int main() {
  scanf("%d%d%d%d%I64d", &n, &A, &cf, &cm, &M);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &ipt[i].val);
    ipt[i].idx = i;
  }
  sort(ipt + 1, ipt + n + 1, cmp);
  for (int i = 1; i <= n; i++) skill[i] = (long long)ipt[i].val;
  sum[1] = skill[1];
  for (int i = 2; i <= n; i++) sum[i] = sum[i - 1] + skill[i];
  long long rate = 0;
  for (int now = 0; now <= n; now++) {
    if (now > 0) rate = rate + max(0LL, A - skill[now]);
    if (M - rate >= 0) solve(now + 1, n, M - rate);
  }
  printf("%I64d\n", Ans);
  for (int i = 1; i <= n; i++)
    if (i <= AnsFull)
      opt[ipt[i].idx] = A;
    else
      opt[ipt[i].idx] = max(AnsLevel, ipt[i].val);
  for (int i = 1; i <= n; i++) printf("%d ", opt[i]);
  printf("\n");
  return 0;
}
