import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> ret = new ArrayList<String>();
		while (sc.hasNext()) {
			long A = sc.nextLong();
			long B = sc.nextLong();

			long a = A;
			long b = B;
			int i;
			long G = 1; // ?????§??¬?´???°
			boolean flg;
			do {
				flg = false;
				long max = (a >= b) ? a : b;
				for (i = 2; i < max; i++) {
					if (a % i == 0 && b % i == 0) {
						a = a / i;
						b = b / i;
						G = G * i;
						flg = true;
						break;
					}
				}
			} while (flg);
			long L = A * B / G;
			ret.add(G + " " + L);
		}
		for (String ans : ret) {
			System.out.println(ans);
		}
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> ret = new ArrayList<String>();
		while (sc.hasNext()) {
			long A = sc.nextLong();
			long B = sc.nextLong();

			long a = A;
			long b = B;
			int i;
			long G = 1; // ?????§??¬?´???°
			boolean flg;
			do {
				flg = false;
				long max = (a >= b) ? a : b;
				for (i = 2; i < max; i++) {
					if (a % i == 0 && b % i == 0) {
						a = a / i;
						b = b / i;
						G = G * i;
						flg = true;
						break;
					}
				}
			} while (flg);
			long L = A * B / G;
			ret.add(G + " " + L);
		}
		for (String ans : ret) {
			System.out.println(ans);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> ret = new ArrayList<String>();
		while (sc.hasNext()) {
			long A = sc.nextLong();
			long B = sc.nextLong();

			long a = A;
			long b = B;
			int i;
			long G = 1; // ?????§??¬?´???°
			boolean flg;
			do {
				flg = false;
				long max = (a >= b) ? a : b;
				for (i = 2; i < max; i++) {
					if (a % i == 0 && b % i == 0) {
						a = a / i;
						b = b / i;
						G = G * i;
						flg = true;
						break;
					}
				}
			} while (flg);
			long L = A * B / G;
			ret.add(G + " " + L);
		}
		for (String ans : ret) {
			System.out.println(ans);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		List<String> ret = new ArrayList<String>();
		while (sc.hasNext()) {
			long A = sc.nextLong();
			long B = sc.nextLong();

			long a = A;
			long b = B;
			int i;
			long G = 1; // ?????§??¬?´???°
			boolean flg;
			do {
				flg = false;
				long max = (a >= b) ? a : b;
				for (i = 2; i < max; i++) {
					if (a % i == 0 && b % i == 0) {
						a = a / i;
						b = b / i;
						G = G * i;
						flg = true;
						break;
					}
				}
			} while (flg);
			long L = A * B / G;
			ret.add(G + " " + L);
		}
		for (String ans : ret) {
			System.out.println(ans);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) List<String> ret = new ArrayList<String>(); ret new ArrayList<String>() while (sc.hasNext()) {
			long A = sc.nextLong();
			long B = sc.nextLong();

			long a = A;
			long b = B;
			int i;
			long G = 1; // ?????§??¬?´???°
			boolean flg;
			do {
				flg = false;
				long max = (a >= b) ? a : b;
				for (i = 2; i < max; i++) {
					if (a % i == 0 && b % i == 0) {
						a = a / i;
						b = b / i;
						G = G * i;
						flg = true;
						break;
					}
				}
			} while (flg);
			long L = A * B / G;
			ret.add(G + " " + L);
		} sc.hasNext() sc.hasNext sc {
			long A = sc.nextLong();
			long B = sc.nextLong();

			long a = A;
			long b = B;
			int i;
			long G = 1; // ?????§??¬?´???°
			boolean flg;
			do {
				flg = false;
				long max = (a >= b) ? a : b;
				for (i = 2; i < max; i++) {
					if (a % i == 0 && b % i == 0) {
						a = a / i;
						b = b / i;
						G = G * i;
						flg = true;
						break;
					}
				}
			} while (flg);
			long L = A * B / G;
			ret.add(G + " " + L);
		} long A = sc.nextLong(); A sc.nextLong() sc.nextLong sc long B = sc.nextLong(); B sc.nextLong() sc.nextLong sc long a = A; a A long b = B; b B int i; i long G = 1; G 1 boolean flg; flg do {
				flg = false;
				long max = (a >= b) ? a : b;
				for (i = 2; i < max; i++) {
					if (a % i == 0 && b % i == 0) {
						a = a / i;
						b = b / i;
						G = G * i;
						flg = true;
						break;
					}
				}
			} while (flg); flg {
				flg = false;
				long max = (a >= b) ? a : b;
				for (i = 2; i < max; i++) {
					if (a % i == 0 && b % i == 0) {
						a = a / i;
						b = b / i;
						G = G * i;
						flg = true;
						break;
					}
				}
			} flg = false flg false long max = (a >= b) ? a : b; max (a >= b) ? a : b (a >= b) a b a b for (i = 2; i < max; i++) {
					if (a % i == 0 && b % i == 0) {
						a = a / i;
						b = b / i;
						G = G * i;
						flg = true;
						break;
					}
				} i = 2; i = 2 i 2 i < max i max i++ i++ i {
					if (a % i == 0 && b % i == 0) {
						a = a / i;
						b = b / i;
						G = G * i;
						flg = true;
						break;
					}
				} {
					if (a % i == 0 && b % i == 0) {
						a = a / i;
						b = b / i;
						G = G * i;
						flg = true;
						break;
					}
				} if (a % i == 0 && b % i == 0) {
						a = a / i;
						b = b / i;
						G = G * i;
						flg = true;
						break;
					} a % i == 0 && b % i == 0 a % i == 0 a % i a i 0 b % i == 0 b % i b i 0 {
						a = a / i;
						b = b / i;
						G = G * i;
						flg = true;
						break;
					} a = a / i a a / i a i b = b / i b b / i b i G = G * i G G * i G i flg = true flg true break; long L = A * B / G; L A * B / G A * B A B G ret.add(G + " " + L) ret.add ret G + " " + L G + " " + L G " " L for (String ans : ret) {
			System.out.println(ans);
		} String ans ret {
			System.out.println(ans);
		} {
			System.out.println(ans);
		} System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> ret = new ArrayList<String>();
		while (sc.hasNext()) {
			long A = sc.nextLong();
			long B = sc.nextLong();

			long a = A;
			long b = B;
			int i;
			long G = 1; // ?????§??¬?´???°
			boolean flg;
			do {
				flg = false;
				long max = (a >= b) ? a : b;
				for (i = 2; i < max; i++) {
					if (a % i == 0 && b % i == 0) {
						a = a / i;
						b = b / i;
						G = G * i;
						flg = true;
						break;
					}
				}
			} while (flg);
			long L = A * B / G;
			ret.add(G + " " + L);
		}
		for (String ans : ret) {
			System.out.println(ans);
		}
	}
}