#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  long long m = INT64_MAX;
  int len = max(X, Y);
  int am = 0, bm = 0, cm = 0;
  for (int ch = 0; ch <= len; ++ch) {
    int a = (X - ch);
    if (a < 0) {
      a = 0;
    }
    int b = (Y - ch);
    if (b < 0) {
      b = 0;
    }
    long long v = (long long)A * a + (long long)B * b + (long long)C * ch * 2;
    if (m > v) {
      m = v;
      am = a;
      bm = b;
      cm = ch * 2;
    }
  }
  cout << m << endl;
  cout << am << " " << bm << " " << cm << endl;
  return 0;
}
