#include <bits/stdc++.h>   using namespace std;   template <typename T>   void pr(vector<T> &v) {     for (int i = 0; i < (int)(v).size(); i++) cout << v[i] <<    ;     cout <<   n ;     ;   }   template <typename T>   void pr(vector<vector<T>> &v) {     for (int i = 0; i < (int)(v).size(); i++) {       pr(v[i]);     }   }   template <typename T>   void re(T &x) {     cin >> x;   }   template <typename T>   void re(vector<T> &a) {     for (int i = 0; i < (int)(a).size(); i++) re(a[i]);   }   template <class Arg, class... Args>   void re(Arg &first, Args &...rest) {     re(first);     re(rest...);   }   template <typename T>   void pr(T x) {     cout << x <<   n ;     ;   }   template <class Arg, class... Args>   void pr(const Arg &first, const Args &...rest) {     cout << first <<    ;     pr(rest...);     cout <<   n ;     ;   }   void ps() {     cout <<   n ;     ;   }   template <class T, class... Ts>   void ps(const T &t, const Ts &...ts) {     cout << t;     if (sizeof...(ts)) cout <<    ;     ps(ts...);   }   const long long MOD = 998244353;   long double PI = 4 * atan(1);   long double eps = 1e-12;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     long long n, A, cf, cm, m;     cin >> n >> A >> cf >> cm >> m;     vector<pair<long long, int>> a(n + 1);     for (int i = 1; i < n + 1; i++) {       cin >> a[i].first;       a[i].second = i;     }     vector<long long> pre(n + 1);     vector<long long> pre2(n + 1);     sort(a.begin(), a.end());     vector<long long> ac(n);     long long minv = MOD;     for (int i = 0; i < n; i++) {       ac[i] = a[i + 1].first;       minv = min(minv, ac[i]);     }     pre[0] = 0;     pre2[0] = 0;     for (int i = 1; i < n + 1; i++) {       pre[i] = a[n - i + 1].first + pre[i - 1];       pre2[i] = a[i].first + pre2[i - 1];     }     long long ans = cm * minv;     long long ind = 0;     long long besti = 0;     long long bestm = 0;     for (int i = 0; i < n + 1; i++) {       long long cost = (i)*A - pre[i];       if (cost > m) {         break;       }       long long lo = 0;       long long hi = A;       while (lo != hi) {         long long mid = (lo + hi + 1) / 2;         vector<long long>::iterator high =             upper_bound(ac.begin(), ac.begin() + n - i, mid);         long long ntm = high - ac.begin();         long long cost2 = cost + (mid * ntm - pre2[ntm]);         if (cost2 <= m) {           if (i * cf + cm * mid > ans) {             ans = i * cf + cm * mid;             besti = i;             bestm = mid;           }           lo = mid;         } else {           hi = mid - 1;         }       }     }     for (int i = 0; i < besti; i++) {       a[n - i].first = A;     }     for (int i = 1; i < n + 1; i++) {       if (a[i].first < bestm) a[i].first = bestm;     }     vector<long long> out(n + 1);     for (int i = 1; i < n + 1; i++) {       out[a[i].second] = a[i].first;     }     cout << ans <<   n ;     ;     for (int i = 1; i < n + 1; i++) {       cout << out[i] <<    ;     }     cout <<   n ;     ;   }   