import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import javax.xml.crypto.KeySelector.Purpose;

public class Main {
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

		try {
			while (input.ready()) {
				String[] dataStr = input.readLine().split(" ");
				int[] dataInt = new int[dataStr.length];
				for (int i = 0; i < dataStr.length; i++) {
					dataInt[i] = Integer.valueOf(dataStr[i]);
				}
				System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	/***
	 * ?????§??¬?´???°
	 */
	public static int getGCD(int a, int b) {
		if (a == b)
			return a;
		int d = 1;
		if (a < b) {
			d = a;
		} else {
			d = b;
		}
		for (int i = d; i > 0; i--) {
			if ((a % i == 0) & (b % i == 0)) {
				return i;
			}
		}
		return 0;
	}

	/***
	 * ????°???¬?????°
	 *
	 * @param a
	 * @param b
	 * @return
	 */
	public static int getLCM(int a, int b) {
		int productA = a;
		int productB = b;
		while (productA <= 2000000000) {
			if (productA == productB) {
				return productA;
			}
			if (productA < productB) {
				productA += a;
			} else {
				productB += b;
			}
		}
		return 0;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import javax.xml.crypto.KeySelector.Purpose; Purpose javax.xml.crypto.KeySelector public class Main {
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

		try {
			while (input.ready()) {
				String[] dataStr = input.readLine().split(" ");
				int[] dataInt = new int[dataStr.length];
				for (int i = 0; i < dataStr.length; i++) {
					dataInt[i] = Integer.valueOf(dataStr[i]);
				}
				System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	/***
	 * ?????§??¬?´???°
	 */
	public static int getGCD(int a, int b) {
		if (a == b)
			return a;
		int d = 1;
		if (a < b) {
			d = a;
		} else {
			d = b;
		}
		for (int i = d; i > 0; i--) {
			if ((a % i == 0) & (b % i == 0)) {
				return i;
			}
		}
		return 0;
	}

	/***
	 * ????°???¬?????°
	 *
	 * @param a
	 * @param b
	 * @return
	 */
	public static int getLCM(int a, int b) {
		int productA = a;
		int productB = b;
		while (productA <= 2000000000) {
			if (productA == productB) {
				return productA;
			}
			if (productA < productB) {
				productA += a;
			} else {
				productB += b;
			}
		}
		return 0;
	}
} Main public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

		try {
			while (input.ready()) {
				String[] dataStr = input.readLine().split(" ");
				int[] dataInt = new int[dataStr.length];
				for (int i = 0; i < dataStr.length; i++) {
					dataInt[i] = Integer.valueOf(dataStr[i]);
				}
				System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	} main {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

		try {
			while (input.ready()) {
				String[] dataStr = input.readLine().split(" ");
				int[] dataInt = new int[dataStr.length];
				for (int i = 0; i < dataStr.length; i++) {
					dataInt[i] = Integer.valueOf(dataStr[i]);
				}
				System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	} BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) try {
			while (input.ready()) {
				String[] dataStr = input.readLine().split(" ");
				int[] dataInt = new int[dataStr.length];
				for (int i = 0; i < dataStr.length; i++) {
					dataInt[i] = Integer.valueOf(dataStr[i]);
				}
				System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
			}
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			while (input.ready()) {
				String[] dataStr = input.readLine().split(" ");
				int[] dataInt = new int[dataStr.length];
				for (int i = 0; i < dataStr.length; i++) {
					dataInt[i] = Integer.valueOf(dataStr[i]);
				}
				System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
			}
		} while (input.ready()) {
				String[] dataStr = input.readLine().split(" ");
				int[] dataInt = new int[dataStr.length];
				for (int i = 0; i < dataStr.length; i++) {
					dataInt[i] = Integer.valueOf(dataStr[i]);
				}
				System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
			} input.ready() input.ready input {
				String[] dataStr = input.readLine().split(" ");
				int[] dataInt = new int[dataStr.length];
				for (int i = 0; i < dataStr.length; i++) {
					dataInt[i] = Integer.valueOf(dataStr[i]);
				}
				System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
			} String[] dataStr = input.readLine().split(" "); dataStr input.readLine().split(" ") input.readLine().split input.readLine() input.readLine input " " int[] dataInt = new int[dataStr.length]; dataInt new int[dataStr.length] dataStr.length dataStr dataStr.length for (int i = 0; i < dataStr.length; i++) {
					dataInt[i] = Integer.valueOf(dataStr[i]);
				} int i = 0; int i = 0; i 0 i < dataStr.length i dataStr.length dataStr dataStr.length i++ i++ i {
					dataInt[i] = Integer.valueOf(dataStr[i]);
				} {
					dataInt[i] = Integer.valueOf(dataStr[i]);
				} dataInt[i] = Integer.valueOf(dataStr[i]) dataInt[i] dataInt i Integer.valueOf(dataStr[i]) Integer.valueOf Integer dataStr[i] dataStr i System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1])) System.out.println System.out System System.out getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]) getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]) getGCD(dataInt[0], dataInt[1]) getGCD dataInt[0] dataInt 0 dataInt[1] dataInt 1 " " getLCM(dataInt[0], dataInt[1]) getLCM dataInt[0] dataInt 0 dataInt[1] dataInt 1 String[] args args /***
	 * ?????§??¬?´???°
	 */
	public static int getGCD(int a, int b) {
		if (a == b)
			return a;
		int d = 1;
		if (a < b) {
			d = a;
		} else {
			d = b;
		}
		for (int i = d; i > 0; i--) {
			if ((a % i == 0) & (b % i == 0)) {
				return i;
			}
		}
		return 0;
	} getGCD {
		if (a == b)
			return a;
		int d = 1;
		if (a < b) {
			d = a;
		} else {
			d = b;
		}
		for (int i = d; i > 0; i--) {
			if ((a % i == 0) & (b % i == 0)) {
				return i;
			}
		}
		return 0;
	} if (a == b)
			return a; a == b a b return a; a int d = 1; d 1 if (a < b) {
			d = a;
		} else {
			d = b;
		} a < b a b {
			d = a;
		} d = a d a {
			d = b;
		} d = b d b for (int i = d; i > 0; i--) {
			if ((a % i == 0) & (b % i == 0)) {
				return i;
			}
		} int i = d; int i = d; i d i > 0 i 0 i-- i-- i {
			if ((a % i == 0) & (b % i == 0)) {
				return i;
			}
		} {
			if ((a % i == 0) & (b % i == 0)) {
				return i;
			}
		} if ((a % i == 0) & (b % i == 0)) {
				return i;
			} (a % i == 0) & (b % i == 0) (a % i == 0) a % i a i 0 (b % i == 0) b % i b i 0 {
				return i;
			} return i; i return 0; 0 int a a int b b /***
	 * ????°???¬?????°
	 *
	 * @param a
	 * @param b
	 * @return
	 */
	public static int getLCM(int a, int b) {
		int productA = a;
		int productB = b;
		while (productA <= 2000000000) {
			if (productA == productB) {
				return productA;
			}
			if (productA < productB) {
				productA += a;
			} else {
				productB += b;
			}
		}
		return 0;
	} getLCM {
		int productA = a;
		int productB = b;
		while (productA <= 2000000000) {
			if (productA == productB) {
				return productA;
			}
			if (productA < productB) {
				productA += a;
			} else {
				productB += b;
			}
		}
		return 0;
	} int productA = a; productA a int productB = b; productB b while (productA <= 2000000000) {
			if (productA == productB) {
				return productA;
			}
			if (productA < productB) {
				productA += a;
			} else {
				productB += b;
			}
		} productA <= 2000000000 productA 2000000000 {
			if (productA == productB) {
				return productA;
			}
			if (productA < productB) {
				productA += a;
			} else {
				productB += b;
			}
		} if (productA == productB) {
				return productA;
			} productA == productB productA productB {
				return productA;
			} return productA; productA if (productA < productB) {
				productA += a;
			} else {
				productB += b;
			} productA < productB productA productB {
				productA += a;
			} productA += a productA a {
				productB += b;
			} productB += b productB b return 0; 0 int a a int b b public class Main {
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

		try {
			while (input.ready()) {
				String[] dataStr = input.readLine().split(" ");
				int[] dataInt = new int[dataStr.length];
				for (int i = 0; i < dataStr.length; i++) {
					dataInt[i] = Integer.valueOf(dataStr[i]);
				}
				System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	/***
	 * ?????§??¬?´???°
	 */
	public static int getGCD(int a, int b) {
		if (a == b)
			return a;
		int d = 1;
		if (a < b) {
			d = a;
		} else {
			d = b;
		}
		for (int i = d; i > 0; i--) {
			if ((a % i == 0) & (b % i == 0)) {
				return i;
			}
		}
		return 0;
	}

	/***
	 * ????°???¬?????°
	 *
	 * @param a
	 * @param b
	 * @return
	 */
	public static int getLCM(int a, int b) {
		int productA = a;
		int productB = b;
		while (productA <= 2000000000) {
			if (productA == productB) {
				return productA;
			}
			if (productA < productB) {
				productA += a;
			} else {
				productB += b;
			}
		}
		return 0;
	}
} public class Main {
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

		try {
			while (input.ready()) {
				String[] dataStr = input.readLine().split(" ");
				int[] dataInt = new int[dataStr.length];
				for (int i = 0; i < dataStr.length; i++) {
					dataInt[i] = Integer.valueOf(dataStr[i]);
				}
				System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	/***
	 * ?????§??¬?´???°
	 */
	public static int getGCD(int a, int b) {
		if (a == b)
			return a;
		int d = 1;
		if (a < b) {
			d = a;
		} else {
			d = b;
		}
		for (int i = d; i > 0; i--) {
			if ((a % i == 0) & (b % i == 0)) {
				return i;
			}
		}
		return 0;
	}

	/***
	 * ????°???¬?????°
	 *
	 * @param a
	 * @param b
	 * @return
	 */
	public static int getLCM(int a, int b) {
		int productA = a;
		int productB = b;
		while (productA <= 2000000000) {
			if (productA == productB) {
				return productA;
			}
			if (productA < productB) {
				productA += a;
			} else {
				productB += b;
			}
		}
		return 0;
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import javax.xml.crypto.KeySelector.Purpose;

public class Main {
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

		try {
			while (input.ready()) {
				String[] dataStr = input.readLine().split(" ");
				int[] dataInt = new int[dataStr.length];
				for (int i = 0; i < dataStr.length; i++) {
					dataInt[i] = Integer.valueOf(dataStr[i]);
				}
				System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	/***
	 * ?????§??¬?´???°
	 */
	public static int getGCD(int a, int b) {
		if (a == b)
			return a;
		int d = 1;
		if (a < b) {
			d = a;
		} else {
			d = b;
		}
		for (int i = d; i > 0; i--) {
			if ((a % i == 0) & (b % i == 0)) {
				return i;
			}
		}
		return 0;
	}

	/***
	 * ????°???¬?????°
	 *
	 * @param a
	 * @param b
	 * @return
	 */
	public static int getLCM(int a, int b) {
		int productA = a;
		int productB = b;
		while (productA <= 2000000000) {
			if (productA == productB) {
				return productA;
			}
			if (productA < productB) {
				productA += a;
			} else {
				productB += b;
			}
		}
		return 0;
	}
}