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


public class Main {
	private	static	BufferedReader br = null;

	static {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int[]	aPair = null;

		while((aPair = parsePair()) != null) {
			calc(aPair);
		}
	}

	private static int[] parsePair() {
		int[]	aPair = null;

		try {
			String line = br.readLine();
			if (line != null) {
				if (!line.isEmpty()) {
					aPair = new int[2];
	
					String[]	as = line.split(" ");
					int			n1 = Integer.parseInt(as[0]);
					int			n2 = Integer.parseInt(as[1]);
	
					aPair[0] = n1;
					aPair[1] = n2;
				}
			}
		}
		catch (NumberFormatException e) {}
		catch (IOException e) {}

		return aPair;
	}

	private static void calc(int[] aMatrix) {
		int	nGcd = gcd(aMatrix[0], aMatrix[1]);							// 最大公約数
		int	nLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd);	// 最小公倍数

		System.out.printf("%d %d\n", nGcd, nLcm);
	}

	private static int gcd(int n1, int n2) {
		int		nGcd = 0;			// 最大公約数
		int[]	aNum = new int[3];	// 計算用の配列

		if (n1 == n2) {
			nGcd = n1;
		}
		else {
			aNum[0] = n1;
			aNum[1] = n2;
			aNum[2] = Math.abs(n1 - n2);

			Arrays.sort(aNum);
			nGcd = gcd(aNum[0], aNum[1]);
		}
		
		return nGcd;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util public class Main {
	private	static	BufferedReader br = null;

	static {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int[]	aPair = null;

		while((aPair = parsePair()) != null) {
			calc(aPair);
		}
	}

	private static int[] parsePair() {
		int[]	aPair = null;

		try {
			String line = br.readLine();
			if (line != null) {
				if (!line.isEmpty()) {
					aPair = new int[2];
	
					String[]	as = line.split(" ");
					int			n1 = Integer.parseInt(as[0]);
					int			n2 = Integer.parseInt(as[1]);
	
					aPair[0] = n1;
					aPair[1] = n2;
				}
			}
		}
		catch (NumberFormatException e) {}
		catch (IOException e) {}

		return aPair;
	}

	private static void calc(int[] aMatrix) {
		int	nGcd = gcd(aMatrix[0], aMatrix[1]);							// 最大公約数
		int	nLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd);	// 最小公倍数

		System.out.printf("%d %d\n", nGcd, nLcm);
	}

	private static int gcd(int n1, int n2) {
		int		nGcd = 0;			// 最大公約数
		int[]	aNum = new int[3];	// 計算用の配列

		if (n1 == n2) {
			nGcd = n1;
		}
		else {
			aNum[0] = n1;
			aNum[1] = n2;
			aNum[2] = Math.abs(n1 - n2);

			Arrays.sort(aNum);
			nGcd = gcd(aNum[0], aNum[1]);
		}
		
		return nGcd;
	}
} Main private	static	BufferedReader br = null; br null /**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int[]	aPair = null;

		while((aPair = parsePair()) != null) {
			calc(aPair);
		}
	} main {
		// TODO Auto-generated method stub
		int[]	aPair = null;

		while((aPair = parsePair()) != null) {
			calc(aPair);
		}
	} int[]	aPair = null; aPair null while((aPair = parsePair()) != null) {
			calc(aPair);
		} (aPair = parsePair()) != null (aPair = parsePair()) aPair parsePair() parsePair null {
			calc(aPair);
		} calc(aPair) calc aPair String[] args args private static int[] parsePair() {
		int[]	aPair = null;

		try {
			String line = br.readLine();
			if (line != null) {
				if (!line.isEmpty()) {
					aPair = new int[2];
	
					String[]	as = line.split(" ");
					int			n1 = Integer.parseInt(as[0]);
					int			n2 = Integer.parseInt(as[1]);
	
					aPair[0] = n1;
					aPair[1] = n2;
				}
			}
		}
		catch (NumberFormatException e) {}
		catch (IOException e) {}

		return aPair;
	} parsePair {
		int[]	aPair = null;

		try {
			String line = br.readLine();
			if (line != null) {
				if (!line.isEmpty()) {
					aPair = new int[2];
	
					String[]	as = line.split(" ");
					int			n1 = Integer.parseInt(as[0]);
					int			n2 = Integer.parseInt(as[1]);
	
					aPair[0] = n1;
					aPair[1] = n2;
				}
			}
		}
		catch (NumberFormatException e) {}
		catch (IOException e) {}

		return aPair;
	} int[]	aPair = null; aPair null try {
			String line = br.readLine();
			if (line != null) {
				if (!line.isEmpty()) {
					aPair = new int[2];
	
					String[]	as = line.split(" ");
					int			n1 = Integer.parseInt(as[0]);
					int			n2 = Integer.parseInt(as[1]);
	
					aPair[0] = n1;
					aPair[1] = n2;
				}
			}
		}
		catch (NumberFormatException e) {}
		catch (IOException e) {} catch (NumberFormatException e) {} NumberFormatException e {} catch (IOException e) {} IOException e {} {
			String line = br.readLine();
			if (line != null) {
				if (!line.isEmpty()) {
					aPair = new int[2];
	
					String[]	as = line.split(" ");
					int			n1 = Integer.parseInt(as[0]);
					int			n2 = Integer.parseInt(as[1]);
	
					aPair[0] = n1;
					aPair[1] = n2;
				}
			}
		} String line = br.readLine(); line br.readLine() br.readLine br if (line != null) {
				if (!line.isEmpty()) {
					aPair = new int[2];
	
					String[]	as = line.split(" ");
					int			n1 = Integer.parseInt(as[0]);
					int			n2 = Integer.parseInt(as[1]);
	
					aPair[0] = n1;
					aPair[1] = n2;
				}
			} line != null line null {
				if (!line.isEmpty()) {
					aPair = new int[2];
	
					String[]	as = line.split(" ");
					int			n1 = Integer.parseInt(as[0]);
					int			n2 = Integer.parseInt(as[1]);
	
					aPair[0] = n1;
					aPair[1] = n2;
				}
			} if (!line.isEmpty()) {
					aPair = new int[2];
	
					String[]	as = line.split(" ");
					int			n1 = Integer.parseInt(as[0]);
					int			n2 = Integer.parseInt(as[1]);
	
					aPair[0] = n1;
					aPair[1] = n2;
				} !line.isEmpty() line.isEmpty() line.isEmpty line {
					aPair = new int[2];
	
					String[]	as = line.split(" ");
					int			n1 = Integer.parseInt(as[0]);
					int			n2 = Integer.parseInt(as[1]);
	
					aPair[0] = n1;
					aPair[1] = n2;
				} aPair = new int[2] aPair new int[2] 2 String[]	as = line.split(" "); as line.split(" ") line.split line " " int			n1 = Integer.parseInt(as[0]); n1 Integer.parseInt(as[0]) Integer.parseInt Integer as[0] as 0 int			n2 = Integer.parseInt(as[1]); n2 Integer.parseInt(as[1]) Integer.parseInt Integer as[1] as 1 aPair[0] = n1 aPair[0] aPair 0 n1 aPair[1] = n2 aPair[1] aPair 1 n2 return aPair; aPair private static void calc(int[] aMatrix) {
		int	nGcd = gcd(aMatrix[0], aMatrix[1]);							// 最大公約数
		int	nLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd);	// 最小公倍数

		System.out.printf("%d %d\n", nGcd, nLcm);
	} calc {
		int	nGcd = gcd(aMatrix[0], aMatrix[1]);							// 最大公約数
		int	nLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd);	// 最小公倍数

		System.out.printf("%d %d\n", nGcd, nLcm);
	} int	nGcd = gcd(aMatrix[0], aMatrix[1]); nGcd gcd(aMatrix[0], aMatrix[1]) gcd aMatrix[0] aMatrix 0 aMatrix[1] aMatrix 1 int	nLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd); nLcm (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd) (nGcd == 0) nGcd 0 0 aMatrix[0] * (aMatrix[1] / nGcd) aMatrix[0] aMatrix 0 (aMatrix[1] / nGcd) aMatrix[1] aMatrix 1 nGcd System.out.printf("%d %d\n", nGcd, nLcm) System.out.printf System.out System System.out "%d %d\n" nGcd nLcm int[] aMatrix aMatrix private static int gcd(int n1, int n2) {
		int		nGcd = 0;			// 最大公約数
		int[]	aNum = new int[3];	// 計算用の配列

		if (n1 == n2) {
			nGcd = n1;
		}
		else {
			aNum[0] = n1;
			aNum[1] = n2;
			aNum[2] = Math.abs(n1 - n2);

			Arrays.sort(aNum);
			nGcd = gcd(aNum[0], aNum[1]);
		}
		
		return nGcd;
	} gcd {
		int		nGcd = 0;			// 最大公約数
		int[]	aNum = new int[3];	// 計算用の配列

		if (n1 == n2) {
			nGcd = n1;
		}
		else {
			aNum[0] = n1;
			aNum[1] = n2;
			aNum[2] = Math.abs(n1 - n2);

			Arrays.sort(aNum);
			nGcd = gcd(aNum[0], aNum[1]);
		}
		
		return nGcd;
	} int		nGcd = 0; nGcd 0 int[]	aNum = new int[3]; aNum new int[3] 3 if (n1 == n2) {
			nGcd = n1;
		}
		else {
			aNum[0] = n1;
			aNum[1] = n2;
			aNum[2] = Math.abs(n1 - n2);

			Arrays.sort(aNum);
			nGcd = gcd(aNum[0], aNum[1]);
		} n1 == n2 n1 n2 {
			nGcd = n1;
		} nGcd = n1 nGcd n1 {
			aNum[0] = n1;
			aNum[1] = n2;
			aNum[2] = Math.abs(n1 - n2);

			Arrays.sort(aNum);
			nGcd = gcd(aNum[0], aNum[1]);
		} aNum[0] = n1 aNum[0] aNum 0 n1 aNum[1] = n2 aNum[1] aNum 1 n2 aNum[2] = Math.abs(n1 - n2) aNum[2] aNum 2 Math.abs(n1 - n2) Math.abs Math n1 - n2 n1 n2 Arrays.sort(aNum) Arrays.sort Arrays aNum nGcd = gcd(aNum[0], aNum[1]) nGcd gcd(aNum[0], aNum[1]) gcd aNum[0] aNum 0 aNum[1] aNum 1 return nGcd; nGcd int n1 n1 int n2 n2 public class Main {
	private	static	BufferedReader br = null;

	static {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int[]	aPair = null;

		while((aPair = parsePair()) != null) {
			calc(aPair);
		}
	}

	private static int[] parsePair() {
		int[]	aPair = null;

		try {
			String line = br.readLine();
			if (line != null) {
				if (!line.isEmpty()) {
					aPair = new int[2];
	
					String[]	as = line.split(" ");
					int			n1 = Integer.parseInt(as[0]);
					int			n2 = Integer.parseInt(as[1]);
	
					aPair[0] = n1;
					aPair[1] = n2;
				}
			}
		}
		catch (NumberFormatException e) {}
		catch (IOException e) {}

		return aPair;
	}

	private static void calc(int[] aMatrix) {
		int	nGcd = gcd(aMatrix[0], aMatrix[1]);							// 最大公約数
		int	nLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd);	// 最小公倍数

		System.out.printf("%d %d\n", nGcd, nLcm);
	}

	private static int gcd(int n1, int n2) {
		int		nGcd = 0;			// 最大公約数
		int[]	aNum = new int[3];	// 計算用の配列

		if (n1 == n2) {
			nGcd = n1;
		}
		else {
			aNum[0] = n1;
			aNum[1] = n2;
			aNum[2] = Math.abs(n1 - n2);

			Arrays.sort(aNum);
			nGcd = gcd(aNum[0], aNum[1]);
		}
		
		return nGcd;
	}
} public class Main {
	private	static	BufferedReader br = null;

	static {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int[]	aPair = null;

		while((aPair = parsePair()) != null) {
			calc(aPair);
		}
	}

	private static int[] parsePair() {
		int[]	aPair = null;

		try {
			String line = br.readLine();
			if (line != null) {
				if (!line.isEmpty()) {
					aPair = new int[2];
	
					String[]	as = line.split(" ");
					int			n1 = Integer.parseInt(as[0]);
					int			n2 = Integer.parseInt(as[1]);
	
					aPair[0] = n1;
					aPair[1] = n2;
				}
			}
		}
		catch (NumberFormatException e) {}
		catch (IOException e) {}

		return aPair;
	}

	private static void calc(int[] aMatrix) {
		int	nGcd = gcd(aMatrix[0], aMatrix[1]);							// 最大公約数
		int	nLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd);	// 最小公倍数

		System.out.printf("%d %d\n", nGcd, nLcm);
	}

	private static int gcd(int n1, int n2) {
		int		nGcd = 0;			// 最大公約数
		int[]	aNum = new int[3];	// 計算用の配列

		if (n1 == n2) {
			nGcd = n1;
		}
		else {
			aNum[0] = n1;
			aNum[1] = n2;
			aNum[2] = Math.abs(n1 - n2);

			Arrays.sort(aNum);
			nGcd = gcd(aNum[0], aNum[1]);
		}
		
		return nGcd;
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;


public class Main {
	private	static	BufferedReader br = null;

	static {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int[]	aPair = null;

		while((aPair = parsePair()) != null) {
			calc(aPair);
		}
	}

	private static int[] parsePair() {
		int[]	aPair = null;

		try {
			String line = br.readLine();
			if (line != null) {
				if (!line.isEmpty()) {
					aPair = new int[2];
	
					String[]	as = line.split(" ");
					int			n1 = Integer.parseInt(as[0]);
					int			n2 = Integer.parseInt(as[1]);
	
					aPair[0] = n1;
					aPair[1] = n2;
				}
			}
		}
		catch (NumberFormatException e) {}
		catch (IOException e) {}

		return aPair;
	}

	private static void calc(int[] aMatrix) {
		int	nGcd = gcd(aMatrix[0], aMatrix[1]);							// 最大公約数
		int	nLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd);	// 最小公倍数

		System.out.printf("%d %d\n", nGcd, nLcm);
	}

	private static int gcd(int n1, int n2) {
		int		nGcd = 0;			// 最大公約数
		int[]	aNum = new int[3];	// 計算用の配列

		if (n1 == n2) {
			nGcd = n1;
		}
		else {
			aNum[0] = n1;
			aNum[1] = n2;
			aNum[2] = Math.abs(n1 - n2);

			Arrays.sort(aNum);
			nGcd = gcd(aNum[0], aNum[1]);
		}
		
		return nGcd;
	}
}