#include <bits/stdc++.h>   using namespace std;   int main() {     long long n, a, cf, cm, m;     cin >> n >> a >> cf >> cm >> m;     vector<vector<long long> > stat(n, vector<long long>(2));     for (int i = 0; i < n; i++) {       cin >> stat[i][0];       stat[i][1] = i;     }     stable_sort(stat.begin(), stat.end());     vector<long long> mi(n);     mi[0] = 0;     for (int i = 1; i < n; i++) {       mi[i] = (stat[i][0] - stat[i - 1][0]) * i + mi[i - 1];     }     vector<long long> ma(n);     ma[n - 1] = a - stat[n - 1][0];     for (int i = n - 2; i >= 0; i--) {       ma[i] = ma[i + 1] + a - stat[i][0];     }     if (ma[0] <= m) {       cout << n * cf + a * cm << endl;       for (int i = 0; i < n; i++) {         cout << a <<    ;       }       return 0;     }     long long otv = 0;     long long votv = -1;     long long mn = 0;     long long mn1 = 0;     if (mi[n - 1] > m) {       for (int i = n - 1; i >= 0; i--) {         if (mi[i] <= m) {           otv = (stat[i][0] + (m - mi[i]) / (i + 1)) * cm;           mn = i;           mn1 = (stat[i][0] + (m - mi[i]) / (i + 1));           votv = otv;           break;         }       }     }     if (mi[n - 1] <= m) otv = (stat[n - 1][0] + (m - mi[n - 1]) / n) * cm;     for (int i = n - 1; i >= 0; i--) {       if (m - ma[i] >= 0) {         int nom = upper_bound(mi.begin(), mi.end(), m - ma[i]) - mi.begin();         if (nom >= n || m - ma[i] < mi[nom]) nom--;         if (nom >= i) {           long long h =               (n - i) * cf + (stat[i][0] + (m - mi[i] - ma[i]) / i) * cm;           otv = max(otv,                     (n - i) * cf + (stat[i][0] + (m - mi[i] - ma[i]) / i) * cm);         } else {           long long h = (stat[nom][0] + (m - mi[nom] - ma[i]) / (nom + 1)) * cm +                         (n - i) * cf;           otv = max(otv, (stat[nom][0] + (m - mi[nom] - ma[i]) / (nom + 1)) * cm +                              (n - i) * cf);         }       }     }     if (votv == otv) {       cout << otv << endl;       for (int i = 0; i < n; i++) {         if (i <= mn) stat[i][0] = mn1;       }       for (int i = 0; i < n; i++) {         swap(stat[i][0], stat[i][1]);       }       stable_sort(stat.begin(), stat.end());       for (int i = 0; i < n; i++) {         cout << stat[i][1] <<    ;       }       return 0;     }     if (otv == (stat[n - 1][0] + (m - mi[n - 1]) / n) * cm) {       cout << otv << endl;       for (int i = 0; i < n; i++) {         cout << stat[n - 1][0] + (m - mi[n - 1]) / n <<    ;       }       return 0;     }     long long otv1 = 0;     if (mi[n - 1] <= m) otv1 = stat[n - 1][0] * cm;     for (int i = n - 1; i >= 0; i--) {       if (m - ma[i] >= 0) {         int nom = upper_bound(mi.begin(), mi.end(), m - ma[i]) - mi.begin();         if (nom >= n || m - ma[i] < mi[nom]) nom--;         if (nom >= i) {           otv1 = max(otv1,                      (n - i) * cf + (stat[i][0] + (m - mi[i] - ma[i]) / i) * cm);           if (otv1 == otv) {             for (int j = 0; j < n; j++) {               if (j < i)                 stat[j][0] = stat[i][0] + (m - mi[i] - ma[i]) / i;               else                 stat[j][0] = a;             }             break;           }         } else {           otv1 =               max(otv1, (stat[nom][0] + (m - mi[nom] - ma[i]) / (nom + 1)) * cm +                             (n - i) * cf);           if (otv1 == otv) {             for (int j = 0; j < n; j++) {               if (j <= nom)                 stat[j][0] = stat[nom][0] + (m - mi[nom] - ma[i]) / (nom + 1);               if (j >= i) stat[j][0] = a;             }             break;           }         }       }     }     for (int i = 0; i < n; i++) {       swap(stat[i][0], stat[i][1]);     }     stable_sort(stat.begin(), stat.end());     cout << otv << endl;     for (int i = 0; i < n; i++) {       cout << stat[i][1] <<    ;     }     return 0;   }