#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
const double EPS = 1e-9;
const double PI = 2 * asin(1);
const int INF = 0x7fffffff;
struct Node {
  int id;
  LL val;
  Node(int id = 0, LL val = 0) : id(id), val(val) {}
  bool operator<(const Node &n) const {
    if (val == n.val) {
      return id < n.id;
    }
    return val < n.val;
  }
};
bool cmp_id(Node n1, Node n2) { return n1.id < n2.id; }
int g_n, g_mx, g_mn, g_mxcnt;
LL g_a, g_mnval, g_cnt, g_ans;
vector<Node> vn;
vector<LL> vll_sum;
void pretreat() {}
bool input() {
  if (scanf(" %d %I64d %d %d %I64d", &g_n, &g_a, &g_mx, &g_mn, &g_cnt) == EOF)
    return false;
  vn.clear(), vll_sum.clear();
  for (int i = 0, t; i < g_n; ++i) {
    scanf(" %d", &t);
    vn.emplace_back(i, t);
  }
  return true;
}
bool judge(LL mid, LL rest, int R) {
  int id = lower_bound(vn.begin(), vn.end(), Node(0, mid)) - vn.begin() - 1;
  if (id > R) id = R;
  if (vll_sum[id] + rest >= mid * (id + 1))
    return 1;
  else
    return 0;
}
void solve() {
  sort(vn.begin(), vn.end());
  LL sum = 0, mn;
  g_mxcnt = 0;
  g_mnval = INF;
  for (int i = 0; i < g_n; ++i) {
    if (vn[i].val == g_a) {
      ++g_mxcnt;
    }
    g_mnval = min(g_mnval, vn[i].val);
    sum += vn[i].val;
    vll_sum.push_back(sum);
  }
  mn = g_mnval;
  g_ans = g_mxcnt * g_mx * 1LL + g_mnval * g_mn * 1LL;
  for (int i = g_mxcnt; i <= g_n; ++i) {
    if (i == g_n) {
      LL sb = 1LL * g_a * i;
      if (sb - vll_sum[g_n - 1] <= g_cnt) {
        LL ans = 1LL * g_a * g_mn + 1LL * i * g_mx;
        if (ans > g_ans) {
          g_ans = ans;
          g_mxcnt = i;
          g_mnval = g_a;
        }
      }
    } else {
      LL dge = vll_sum[g_n - 1] - vll_sum[g_n - 1 - i];
      LL sb = 1LL * g_a * i;
      if (sb - dge <= g_cnt) {
        LL rest = g_cnt - (sb - dge);
        LL mid, L = mn, R = g_a - 1;
        LL a = -1;
        while (R - L >= 0) {
          mid = (L + R) / 2;
          if (judge(mid, rest, g_n - 1 - i)) {
            a = max(a, mid);
            L = mid + 1;
          } else
            R = mid - 1;
        }
        LL ans = 1LL * a * g_mn + 1LL * i * g_mx;
        if (ans > g_ans) {
          g_ans = ans;
          g_mxcnt = i;
          g_mnval = a;
        }
      }
    }
  }
  int id = lower_bound(vn.begin(), vn.end(), Node(0, g_mnval)) - vn.begin() - 1;
  for (int i = 0; i <= id; i++) {
    vn[i].val = g_mnval;
  }
  for (int i = g_n - 1; i >= g_n - g_mxcnt; i--) {
    vn[i].val = g_a;
  }
  sort(vn.begin(), vn.end(), cmp_id);
  printf("%I64d\n", g_ans);
  for (int id = 0; id < g_n - 1; id++) {
    printf("%I64d ", vn[id].val);
  }
  printf("%I64d\n", vn[g_n - 1].val);
}
int main() {
  pretreat();
  while (input()) {
    solve();
  }
  return 0;
}
