#include <bits/stdc++.h>
int main() {
  long long A, B, C, X, Y;
  scanf("%ld%ld%ld%ld%ld", &A, &B, &C, &X, &Y);
  long long cc = 0;
  while (cc < X || cc < Y) cc++;
  printf("%d %d\n", cc, C);
  long long money = cc * C * 2;
  for (; cc >= 0; cc--) {
    long long sub = 0;
    if (X > cc) sub += (X - cc) * A;
    if (Y > cc) sub += (Y - cc) * B;
    if (money < sub + cc * C * 2) break;
    money = sub + cc * C * 2;
  }
  printf("%ld\n", money);
}
