import java.util.*; public class Main { static Scanner sc; static long numerator; static long denominator; public static void main(String[] args) { sc = new Scanner(System.in); numerator = 1; denominator = 1; inputNume(sc.nextInt()); inputDeno(sc.nextInt()); calculateGcf(numerator, denominator); if( (numerator >= 0 && denominator < 0)||(numerator < 0 && denominator < 0) ) { numerator *= -1; denominator *= -1; } System.out.println(numerator+" "+denominator); } static void inputNume(int l) { numerator *= sc.nextLong(); for(int i=1;i