#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll p,q,r,a,b,c; cin>>p>>q>>r>>a>>b>>c; ll L=max(max((a-1)*p,(a+b-1)*q),(a+b+c-1)*r)+1; ll R=min(min(a*p,(a+b)*q),(a+b+c)*r); if(L>R) cout<<-1<