public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int a = 1;
		int b = 1;
		while ( sc.hasNext() ) {
			a = sc.nextInt();
			b = sc.nextInt();
			System.out.println( gcd(a, b) + " " + lcm(a, b) );
		}
	}

	public static int gcd(int a, int b) {
		int r;
		int max = Math.max(a, b);
		int mini = Math.min(a, b);
		do {
			r = max % mini; // max = q*mini + r , mini > r
			max = mini;
			mini = r;
		} while (r != 0);
		return max;
	}

	public static int lcm(int a, int b) {
		int d = gcd(a, b);
		return a/d * b;
	}
} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int a = 1;
		int b = 1;
		while ( sc.hasNext() ) {
			a = sc.nextInt();
			b = sc.nextInt();
			System.out.println( gcd(a, b) + " " + lcm(a, b) );
		}
	}

	public static int gcd(int a, int b) {
		int r;
		int max = Math.max(a, b);
		int mini = Math.min(a, b);
		do {
			r = max % mini; // max = q*mini + r , mini > r
			max = mini;
			mini = r;
		} while (r != 0);
		return max;
	}

	public static int lcm(int a, int b) {
		int d = gcd(a, b);
		return a/d * b;
	}
} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int a = 1;
		int b = 1;
		while ( sc.hasNext() ) {
			a = sc.nextInt();
			b = sc.nextInt();
			System.out.println( gcd(a, b) + " " + lcm(a, b) );
		}
	} main {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int a = 1;
		int b = 1;
		while ( sc.hasNext() ) {
			a = sc.nextInt();
			b = sc.nextInt();
			System.out.println( gcd(a, b) + " " + lcm(a, b) );
		}
	} java.util.Scanner sc = new java.util.Scanner(System.in); sc new java.util.Scanner(System.in) int a = 1; a 1 int b = 1; b 1 while ( sc.hasNext() ) {
			a = sc.nextInt();
			b = sc.nextInt();
			System.out.println( gcd(a, b) + " " + lcm(a, b) );
		} sc.hasNext() sc.hasNext sc {
			a = sc.nextInt();
			b = sc.nextInt();
			System.out.println( gcd(a, b) + " " + lcm(a, b) );
		} a = sc.nextInt() a sc.nextInt() sc.nextInt sc b = sc.nextInt() b sc.nextInt() sc.nextInt sc System.out.println( gcd(a, b) + " " + lcm(a, b) ) System.out.println System.out System System.out gcd(a, b) + " " + lcm(a, b) gcd(a, b) + " " + lcm(a, b) gcd(a, b) gcd a b " " lcm(a, b) lcm a b String[] args args public static int gcd(int a, int b) {
		int r;
		int max = Math.max(a, b);
		int mini = Math.min(a, b);
		do {
			r = max % mini; // max = q*mini + r , mini > r
			max = mini;
			mini = r;
		} while (r != 0);
		return max;
	} gcd {
		int r;
		int max = Math.max(a, b);
		int mini = Math.min(a, b);
		do {
			r = max % mini; // max = q*mini + r , mini > r
			max = mini;
			mini = r;
		} while (r != 0);
		return max;
	} int r; r int max = Math.max(a, b); max Math.max(a, b) Math.max Math a b int mini = Math.min(a, b); mini Math.min(a, b) Math.min Math a b do {
			r = max % mini; // max = q*mini + r , mini > r
			max = mini;
			mini = r;
		} while (r != 0); r != 0 r 0 {
			r = max % mini; // max = q*mini + r , mini > r
			max = mini;
			mini = r;
		} r = max % mini r max % mini max mini max = mini max mini mini = r mini r return max; max int a a int b b public static int lcm(int a, int b) {
		int d = gcd(a, b);
		return a/d * b;
	} lcm {
		int d = gcd(a, b);
		return a/d * b;
	} int d = gcd(a, b); d gcd(a, b) gcd a b return a/d * b; a/d * b a/d a d b int a a int b b public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int a = 1;
		int b = 1;
		while ( sc.hasNext() ) {
			a = sc.nextInt();
			b = sc.nextInt();
			System.out.println( gcd(a, b) + " " + lcm(a, b) );
		}
	}

	public static int gcd(int a, int b) {
		int r;
		int max = Math.max(a, b);
		int mini = Math.min(a, b);
		do {
			r = max % mini; // max = q*mini + r , mini > r
			max = mini;
			mini = r;
		} while (r != 0);
		return max;
	}

	public static int lcm(int a, int b) {
		int d = gcd(a, b);
		return a/d * b;
	}
} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int a = 1;
		int b = 1;
		while ( sc.hasNext() ) {
			a = sc.nextInt();
			b = sc.nextInt();
			System.out.println( gcd(a, b) + " " + lcm(a, b) );
		}
	}

	public static int gcd(int a, int b) {
		int r;
		int max = Math.max(a, b);
		int mini = Math.min(a, b);
		do {
			r = max % mini; // max = q*mini + r , mini > r
			max = mini;
			mini = r;
		} while (r != 0);
		return max;
	}

	public static int lcm(int a, int b) {
		int d = gcd(a, b);
		return a/d * b;
	}
} Main
public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int a = 1;
		int b = 1;
		while ( sc.hasNext() ) {
			a = sc.nextInt();
			b = sc.nextInt();
			System.out.println( gcd(a, b) + " " + lcm(a, b) );
		}
	}

	public static int gcd(int a, int b) {
		int r;
		int max = Math.max(a, b);
		int mini = Math.min(a, b);
		do {
			r = max % mini; // max = q*mini + r , mini > r
			max = mini;
			mini = r;
		} while (r != 0);
		return max;
	}

	public static int lcm(int a, int b) {
		int d = gcd(a, b);
		return a/d * b;
	}
}