import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		long a = 0;
		long b = 0;
		while (scanner.hasNext()) {
			a = scanner.nextLong();
			b = scanner.nextLong();

			long lcm = calcLCM(a, b);
			long gcd = calcGCD(a, b, lcm);
			System.out.println(gcd + " " + lcm);
		}

	}

	/**
	 * ?????§??¬?´???°????±???????
	 * @param a ?¬¬????????°
	 * @param b ?¬¬????????°
	 * @return ?????§??¬?´???°
	 */
	private static long calcLCM(long a, long b) {
		long large = a >= b ? a : b;
		long small = a >= b ? b : a;
		long base = a >= b ? b : a;
		while (true) {
			long result = calc(large, small, base);
			if (large == result) {
				return result;
			} else if (large < result) {
				small = large;
				large = result;
				base = base == a ? b : a;
			} else {
				small = result;
			}
		}
	}

	private static long calc(long large, long small, long base) {
		int count = 0;
		while (true) {
			if (large <= base * count + small) {
				return base * count + small;
			}
			count++;
		}
	}

	/**
	 * ????°???¬?????°????±???????
	 * @param a ?¬¬????????°
	 * @param b ?¬¬????????°
	 * @param gcd ?????§??¬?´???°
	 * @return ????°???¬?????°
	 */
	private static long calcGCD(long a, long b, long gcd) {
		return (a * b) / gcd;
	}
} import java.util.Scanner; Scanner java.util public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		long a = 0;
		long b = 0;
		while (scanner.hasNext()) {
			a = scanner.nextLong();
			b = scanner.nextLong();

			long lcm = calcLCM(a, b);
			long gcd = calcGCD(a, b, lcm);
			System.out.println(gcd + " " + lcm);
		}

	}

	/**
	 * ?????§??¬?´???°????±???????
	 * @param a ?¬¬????????°
	 * @param b ?¬¬????????°
	 * @return ?????§??¬?´???°
	 */
	private static long calcLCM(long a, long b) {
		long large = a >= b ? a : b;
		long small = a >= b ? b : a;
		long base = a >= b ? b : a;
		while (true) {
			long result = calc(large, small, base);
			if (large == result) {
				return result;
			} else if (large < result) {
				small = large;
				large = result;
				base = base == a ? b : a;
			} else {
				small = result;
			}
		}
	}

	private static long calc(long large, long small, long base) {
		int count = 0;
		while (true) {
			if (large <= base * count + small) {
				return base * count + small;
			}
			count++;
		}
	}

	/**
	 * ????°???¬?????°????±???????
	 * @param a ?¬¬????????°
	 * @param b ?¬¬????????°
	 * @param gcd ?????§??¬?´???°
	 * @return ????°???¬?????°
	 */
	private static long calcGCD(long a, long b, long gcd) {
		return (a * b) / gcd;
	}
} Main /**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		long a = 0;
		long b = 0;
		while (scanner.hasNext()) {
			a = scanner.nextLong();
			b = scanner.nextLong();

			long lcm = calcLCM(a, b);
			long gcd = calcGCD(a, b, lcm);
			System.out.println(gcd + " " + lcm);
		}

	} main {
		Scanner scanner = new Scanner(System.in);

		long a = 0;
		long b = 0;
		while (scanner.hasNext()) {
			a = scanner.nextLong();
			b = scanner.nextLong();

			long lcm = calcLCM(a, b);
			long gcd = calcGCD(a, b, lcm);
			System.out.println(gcd + " " + lcm);
		}

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long a = 0; a 0 long b = 0; b 0 while (scanner.hasNext()) {
			a = scanner.nextLong();
			b = scanner.nextLong();

			long lcm = calcLCM(a, b);
			long gcd = calcGCD(a, b, lcm);
			System.out.println(gcd + " " + lcm);
		} scanner.hasNext() scanner.hasNext scanner {
			a = scanner.nextLong();
			b = scanner.nextLong();

			long lcm = calcLCM(a, b);
			long gcd = calcGCD(a, b, lcm);
			System.out.println(gcd + " " + lcm);
		} a = scanner.nextLong() a scanner.nextLong() scanner.nextLong scanner b = scanner.nextLong() b scanner.nextLong() scanner.nextLong scanner long lcm = calcLCM(a, b); lcm calcLCM(a, b) calcLCM a b long gcd = calcGCD(a, b, lcm); gcd calcGCD(a, b, lcm) calcGCD a b lcm System.out.println(gcd + " " + lcm) System.out.println System.out System System.out gcd + " " + lcm gcd + " " + lcm gcd " " lcm String[] args args /**
	 * ?????§??¬?´???°????±???????
	 * @param a ?¬¬????????°
	 * @param b ?¬¬????????°
	 * @return ?????§??¬?´???°
	 */
	private static long calcLCM(long a, long b) {
		long large = a >= b ? a : b;
		long small = a >= b ? b : a;
		long base = a >= b ? b : a;
		while (true) {
			long result = calc(large, small, base);
			if (large == result) {
				return result;
			} else if (large < result) {
				small = large;
				large = result;
				base = base == a ? b : a;
			} else {
				small = result;
			}
		}
	} calcLCM {
		long large = a >= b ? a : b;
		long small = a >= b ? b : a;
		long base = a >= b ? b : a;
		while (true) {
			long result = calc(large, small, base);
			if (large == result) {
				return result;
			} else if (large < result) {
				small = large;
				large = result;
				base = base == a ? b : a;
			} else {
				small = result;
			}
		}
	} long large = a >= b ? a : b; large a >= b ? a : b a >= b a b a b long small = a >= b ? b : a; small a >= b ? b : a a >= b a b b a long base = a >= b ? b : a; base a >= b ? b : a a >= b a b b a while (true) {
			long result = calc(large, small, base);
			if (large == result) {
				return result;
			} else if (large < result) {
				small = large;
				large = result;
				base = base == a ? b : a;
			} else {
				small = result;
			}
		} true {
			long result = calc(large, small, base);
			if (large == result) {
				return result;
			} else if (large < result) {
				small = large;
				large = result;
				base = base == a ? b : a;
			} else {
				small = result;
			}
		} long result = calc(large, small, base); result calc(large, small, base) calc large small base if (large == result) {
				return result;
			} else if (large < result) {
				small = large;
				large = result;
				base = base == a ? b : a;
			} else {
				small = result;
			} large == result large result {
				return result;
			} return result; result if (large < result) {
				small = large;
				large = result;
				base = base == a ? b : a;
			} else {
				small = result;
			} large < result large result {
				small = large;
				large = result;
				base = base == a ? b : a;
			} small = large small large large = result large result base = base == a ? b : a base base == a ? b : a base == a base a b a {
				small = result;
			} small = result small result long a a long b b private static long calc(long large, long small, long base) {
		int count = 0;
		while (true) {
			if (large <= base * count + small) {
				return base * count + small;
			}
			count++;
		}
	} calc {
		int count = 0;
		while (true) {
			if (large <= base * count + small) {
				return base * count + small;
			}
			count++;
		}
	} int count = 0; count 0 while (true) {
			if (large <= base * count + small) {
				return base * count + small;
			}
			count++;
		} true {
			if (large <= base * count + small) {
				return base * count + small;
			}
			count++;
		} if (large <= base * count + small) {
				return base * count + small;
			} large <= base * count + small large base * count + small base * count base count small {
				return base * count + small;
			} return base * count + small; base * count + small base * count base count small count++ count long large large long small small long base base /**
	 * ????°???¬?????°????±???????
	 * @param a ?¬¬????????°
	 * @param b ?¬¬????????°
	 * @param gcd ?????§??¬?´???°
	 * @return ????°???¬?????°
	 */
	private static long calcGCD(long a, long b, long gcd) {
		return (a * b) / gcd;
	} calcGCD {
		return (a * b) / gcd;
	} return (a * b) / gcd; (a * b) / gcd (a * b) a b gcd long a a long b b long gcd gcd public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		long a = 0;
		long b = 0;
		while (scanner.hasNext()) {
			a = scanner.nextLong();
			b = scanner.nextLong();

			long lcm = calcLCM(a, b);
			long gcd = calcGCD(a, b, lcm);
			System.out.println(gcd + " " + lcm);
		}

	}

	/**
	 * ?????§??¬?´???°????±???????
	 * @param a ?¬¬????????°
	 * @param b ?¬¬????????°
	 * @return ?????§??¬?´???°
	 */
	private static long calcLCM(long a, long b) {
		long large = a >= b ? a : b;
		long small = a >= b ? b : a;
		long base = a >= b ? b : a;
		while (true) {
			long result = calc(large, small, base);
			if (large == result) {
				return result;
			} else if (large < result) {
				small = large;
				large = result;
				base = base == a ? b : a;
			} else {
				small = result;
			}
		}
	}

	private static long calc(long large, long small, long base) {
		int count = 0;
		while (true) {
			if (large <= base * count + small) {
				return base * count + small;
			}
			count++;
		}
	}

	/**
	 * ????°???¬?????°????±???????
	 * @param a ?¬¬????????°
	 * @param b ?¬¬????????°
	 * @param gcd ?????§??¬?´???°
	 * @return ????°???¬?????°
	 */
	private static long calcGCD(long a, long b, long gcd) {
		return (a * b) / gcd;
	}
} public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		long a = 0;
		long b = 0;
		while (scanner.hasNext()) {
			a = scanner.nextLong();
			b = scanner.nextLong();

			long lcm = calcLCM(a, b);
			long gcd = calcGCD(a, b, lcm);
			System.out.println(gcd + " " + lcm);
		}

	}

	/**
	 * ?????§??¬?´???°????±???????
	 * @param a ?¬¬????????°
	 * @param b ?¬¬????????°
	 * @return ?????§??¬?´???°
	 */
	private static long calcLCM(long a, long b) {
		long large = a >= b ? a : b;
		long small = a >= b ? b : a;
		long base = a >= b ? b : a;
		while (true) {
			long result = calc(large, small, base);
			if (large == result) {
				return result;
			} else if (large < result) {
				small = large;
				large = result;
				base = base == a ? b : a;
			} else {
				small = result;
			}
		}
	}

	private static long calc(long large, long small, long base) {
		int count = 0;
		while (true) {
			if (large <= base * count + small) {
				return base * count + small;
			}
			count++;
		}
	}

	/**
	 * ????°???¬?????°????±???????
	 * @param a ?¬¬????????°
	 * @param b ?¬¬????????°
	 * @param gcd ?????§??¬?´???°
	 * @return ????°???¬?????°
	 */
	private static long calcGCD(long a, long b, long gcd) {
		return (a * b) / gcd;
	}
} Main
import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		long a = 0;
		long b = 0;
		while (scanner.hasNext()) {
			a = scanner.nextLong();
			b = scanner.nextLong();

			long lcm = calcLCM(a, b);
			long gcd = calcGCD(a, b, lcm);
			System.out.println(gcd + " " + lcm);
		}

	}

	/**
	 * ?????§??¬?´???°????±???????
	 * @param a ?¬¬????????°
	 * @param b ?¬¬????????°
	 * @return ?????§??¬?´???°
	 */
	private static long calcLCM(long a, long b) {
		long large = a >= b ? a : b;
		long small = a >= b ? b : a;
		long base = a >= b ? b : a;
		while (true) {
			long result = calc(large, small, base);
			if (large == result) {
				return result;
			} else if (large < result) {
				small = large;
				large = result;
				base = base == a ? b : a;
			} else {
				small = result;
			}
		}
	}

	private static long calc(long large, long small, long base) {
		int count = 0;
		while (true) {
			if (large <= base * count + small) {
				return base * count + small;
			}
			count++;
		}
	}

	/**
	 * ????°???¬?????°????±???????
	 * @param a ?¬¬????????°
	 * @param b ?¬¬????????°
	 * @param gcd ?????§??¬?´???°
	 * @return ????°???¬?????°
	 */
	private static long calcGCD(long a, long b, long gcd) {
		return (a * b) / gcd;
	}
}