import java.util.*; public class Main { static Scanner sc; static int n; static long numerator; static long denominator; public static void main(String[] args) { sc = new Scanner(System.in); numerator = 1; denominator = 1; n = sc.nextInt(); input(0, n); input(n, sc.nextInt()); long gcf = calculateGcf(numerator, denominator); numerator /= gcf; denominator /= gcf; System.out.println(numerator+" "+denominator); } static void input(int l, int m) { for(int i=l;i