#include <bits/stdc++.h>
using namespace std;
const int inf = 1e+9;
const long long mod = 1000000007;
const double PI = 3.14159265358979323846;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int cans(bool f) {
  if (f)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
int fac(int num) {
  if (num == 1)
    return 1;
  else
    return num * fac(num - 1);
}
int main() {
  long long a, b, c, x, y;
  long long ans = 0;
  cin >> a >> b >> c >> x >> y;
  if (a + b >= 2 * c) {
    ans += 2 * c * min(x, y);
    long long m = min(x, y);
    x -= m;
    y -= m;
  }
  ans += x * a + y * b;
  cout << x << y << endl;
  cout << ans << endl;
  return 0;
}
