from collections import defaultdict,deque import sys,heapq,bisect,math,itertools,string,queue,copy,time sys.setrecursionlimit(10**8) INF = float('inf') mod = 10**9+7 eps = 10**-7 def inp(): return int(input()) def inpl(): return list(map(int, input().split())) def inpl_str(): return list(input().split()) P,Q,R = inpl() A,B,C = inpl() MIN = max(P*(A-1),Q*(A+B-1),R*(A+B+C-1)) MAX = min(P*(A) ,Q*(A+B) ,R*(A+B+C)) #print(P*(A-1),Q*(A+B-1),R*(A+B+C-1)) #print(P*(A) ,Q*(A+B) ,R*(A+B+C)) if MIN >= MAX: print(-1) else: print(MIN+1,MAX)