#include <bits/stdc++.h>
using namespace std;
template <typename T>
T in() {
  char ch;
  T n = 0;
  bool ng = false;
  while (1) {
    ch = getchar();
    if (ch == '-') {
      ng = true;
      ch = getchar();
      break;
    }
    if (ch >= '0' && ch <= '9') break;
  }
  while (1) {
    n = n * 10 + (ch - '0');
    ch = getchar();
    if (ch < '0' || ch > '9') break;
  }
  return (ng ? -n : n);
}
template <typename T>
inline T POW(T B, T P) {
  if (P == 0) return 1;
  if (P & 1)
    return B * POW(B, P - 1);
  else
    return (POW(B, P / 2) * POW(B, P / 2));
}
template <typename T>
inline T Gcd(T a, T b) {
  if (a < 0) return Gcd(-a, b);
  if (b < 0) return Gcd(a, -b);
  return (b == 0) ? a : Gcd(b, a % b);
}
template <typename T>
inline T Lcm(T a, T b) {
  if (a < 0) return Lcm(-a, b);
  if (b < 0) return Lcm(a, -b);
  return a * (b / Gcd(a, b));
}
long long Bigmod(long long base, long long power, long long MOD) {
  long long ret = 1;
  while (power) {
    if (power & 1) ret = (ret * base) % MOD;
    base = (base * base) % MOD;
    power >>= 1;
  }
  return ret;
}
bool isVowel(char ch) {
  ch = toupper(ch);
  if (ch == 'A' || ch == 'U' || ch == 'I' || ch == 'O' || ch == 'E')
    return true;
  return false;
}
long long ModInverse(long long number, long long MOD) {
  return Bigmod(number, MOD - 2, MOD);
}
bool isConst(char ch) {
  if (isalpha(ch) && !isVowel(ch)) return true;
  return false;
}
int toInt(string s) {
  int sm;
  stringstream second(s);
  second >> sm;
  return sm;
}
struct z {
  long long int v;
  int id;
  bool operator<(const z &p) const { return (v < p.v); }
};
long long int a[200007];
z b[200007];
long long int n, A, cf, cm, m;
long long int dp[200007];
long long int Sum[200007];
int Dekhi(int l, int r, long long int k) {
  int ans = -1;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (a[b[mid].id] <= k) {
      ans = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  return ans;
}
long long int md;
long long int IsOK(long long int mn) {
  long long int koto = dp[mn];
  long long int tm = m;
  tm -= koto;
  long long int l = a[b[n].id], h = A;
  long long int ans = 0;
  if (mn == n) {
    return (cf * mn + A * cm);
  }
  while (l <= h) {
    long long int now = 0;
    long long int mid = (l + h) / 2LL;
    long long int Id = Dekhi(mn + 1, n, mid);
    if (Id == -1) {
      h = mid - 1;
    } else {
      now = mid * (n - Id + 1LL) - Sum[Id];
      if (now <= tm) {
        ans = mid;
        l = mid + 1;
      } else {
        h = mid - 1;
      }
    }
  }
  md = ans;
  return (ans * cm) + (cf * mn);
}
int main() {
  n = in<long long int>();
  A = in<long long int>(), cf = in<long long int>(), cm = in<long long int>();
  m = in<long long int>();
  int mn = 2000000000;
  for (int i = 1; i < n + 1; i++) {
    a[i] = in<int>();
    mn = ((mn < a[i]) ? mn : a[i]);
    b[i].v = (A - a[i]);
    b[i].id = i;
  }
  sort(b + 1, b + n + 1);
  for (int i = n; i >= 1; i--) {
    Sum[i] = (Sum[i + 1] + a[b[i].id]);
  }
  for (int i = 1; i <= n; i++) {
    dp[i] = dp[i - 1] + b[i].v;
  }
  long long int ans = -1;
  int id;
  long long int mid;
  for (int i = 0; i <= n; i++) {
    if (dp[i] > m) continue;
    long long int tp = IsOK(i);
    if (tp > ans) {
      ans = tp;
      id = i;
      mid = md;
    }
  }
  for (int i = 1; i <= id; i++) {
    a[b[i].id] = A;
  }
  for (int i = id + 1; i <= n; i++) {
    if (a[b[i].id] > mid) continue;
    a[b[i].id] = mid;
  }
  printf("%lld\n", ans);
  for (int i = 1; i <= n; i++) {
    printf("%lld ", a[i]);
  }
  printf("\n");
  return 0;
}
