import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; class Main { public static void main(String[] args) { new Main().run(); } void run() { Scanner sc = new Scanner(System.in); long P = sc.nextLong(); long Q = sc.nextLong(); long R = sc.nextLong(); long A = sc.nextLong(); long B = sc.nextLong(); long C = sc.nextLong(); long min = Math.max(P * (A - 1), Q * (A + B - 1)); min = Math.max(min, R * (A + B + C - 1)); long max = Math.min(P * A, Q * (A + B)); max = Math.min(max, R * (A + B + C)); if (max - min >= 1) { System.out.println((min + 1) + " " + max); } else { System.out.println(-1); } } void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }