#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
long long n, m, A, cf, cm, maxForce = -1, minSkill, minIdx, i, a[N], b[N];
pair<long long, int> sum[N];
inline long long query(long long money, int limit) {
  long long l = sum[1].first, r = A, mid;
  if (limit <= 1) {
    return A;
  }
  while (l < r) {
    mid = (l + r + 1) / 2;
    int x = upper_bound(b + 1, b + limit, mid) - b - 1;
    if (mid * x - sum[x].first <= money)
      l = mid;
    else
      r = mid - 1;
  }
  return r;
}
int main() {
  cin >> n >> A >> cf >> cm >> m;
  for (i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    sum[i].first = a[i];
    sum[i].second = i;
  }
  sort(sum + 1, sum + n + 1);
  for (i = 1; i <= n; ++i) {
    b[i] = sum[i].first;
    sum[i].first += sum[i - 1].first;
  }
  b[n + 1] = A;
  for (i = n + 1; i >= 1; --i) {
    m -= A - b[i];
    if (m < 0) {
      break;
    }
    long long x = query(m, i);
    long long force = cf * (n - i + 1) + cm * x;
    if (maxForce < force) {
      maxForce = force;
      minIdx = i;
      minSkill = x;
    }
  }
  for (i = n; i >= minIdx; --i) {
    a[sum[i].second] = A;
  }
  cout << maxForce << endl;
  for (i = 1; i <= n; ++i) {
    printf("%d ", max(a[i], minSkill));
  }
  return 0;
}
