P,Q,R = map(int, input().split()) A,B,C = map(int, input().split()) B += A C += B minimum = max((A-1)*P, (B-1)*Q, (C-1)*R) + 1 maximum = min(A*P, B*Q, C*R) if minimum > maximum: print(-1) else: print(minimum, maximum)