#include #include #include #include #include #include using namespace std; typedef long long ll; int main() { ll p,q,r,a,b,c,m,M; cin >> p >> q >> r >> a >> b >> c; m=max({(a-1)*p,(a+b-1)*q,(a+b+c-1)*r}); M=min({a*p,(a+b)*q,(a+b+c)*r}); if(m>M) { cout << -1 << endl; } else { cout << m << " " << M << endl; } }