import java.math.BigInteger;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Scanner s = null;
		try {
			s = new Scanner(System.in);

			while (s.hasNextInt()) {
				BigInteger[] num = { s.nextBigInteger(), s.nextBigInteger() };
				Arrays.sort(num, Collections.reverseOrder());
				System.out.println(gcd(num) + " " + lcm(num));
			}

		} finally {
			s.close();
		}

	}

	public static BigInteger gcd(BigInteger[] num) {
		return num[0].gcd(num[1]);
	}

	private static BigInteger lcm(BigInteger[] num) {
		return (num[0].multiply(num[1])).divide(gcd(num));
	}
} import java.math.BigInteger; BigInteger java.math import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util class Main {

	public static void main(String[] args) {
		Scanner s = null;
		try {
			s = new Scanner(System.in);

			while (s.hasNextInt()) {
				BigInteger[] num = { s.nextBigInteger(), s.nextBigInteger() };
				Arrays.sort(num, Collections.reverseOrder());
				System.out.println(gcd(num) + " " + lcm(num));
			}

		} finally {
			s.close();
		}

	}

	public static BigInteger gcd(BigInteger[] num) {
		return num[0].gcd(num[1]);
	}

	private static BigInteger lcm(BigInteger[] num) {
		return (num[0].multiply(num[1])).divide(gcd(num));
	}
} Main public static void main(String[] args) {
		Scanner s = null;
		try {
			s = new Scanner(System.in);

			while (s.hasNextInt()) {
				BigInteger[] num = { s.nextBigInteger(), s.nextBigInteger() };
				Arrays.sort(num, Collections.reverseOrder());
				System.out.println(gcd(num) + " " + lcm(num));
			}

		} finally {
			s.close();
		}

	} main {
		Scanner s = null;
		try {
			s = new Scanner(System.in);

			while (s.hasNextInt()) {
				BigInteger[] num = { s.nextBigInteger(), s.nextBigInteger() };
				Arrays.sort(num, Collections.reverseOrder());
				System.out.println(gcd(num) + " " + lcm(num));
			}

		} finally {
			s.close();
		}

	} Scanner s = null; s null try {
			s = new Scanner(System.in);

			while (s.hasNextInt()) {
				BigInteger[] num = { s.nextBigInteger(), s.nextBigInteger() };
				Arrays.sort(num, Collections.reverseOrder());
				System.out.println(gcd(num) + " " + lcm(num));
			}

		} finally {
			s.close();
		} {
			s.close();
		} s.close() s.close s {
			s = new Scanner(System.in);

			while (s.hasNextInt()) {
				BigInteger[] num = { s.nextBigInteger(), s.nextBigInteger() };
				Arrays.sort(num, Collections.reverseOrder());
				System.out.println(gcd(num) + " " + lcm(num));
			}

		} s = new Scanner(System.in) s new Scanner(System.in) while (s.hasNextInt()) {
				BigInteger[] num = { s.nextBigInteger(), s.nextBigInteger() };
				Arrays.sort(num, Collections.reverseOrder());
				System.out.println(gcd(num) + " " + lcm(num));
			} s.hasNextInt() s.hasNextInt s {
				BigInteger[] num = { s.nextBigInteger(), s.nextBigInteger() };
				Arrays.sort(num, Collections.reverseOrder());
				System.out.println(gcd(num) + " " + lcm(num));
			} BigInteger[] num = { s.nextBigInteger(), s.nextBigInteger() }; num { s.nextBigInteger(), s.nextBigInteger() } s.nextBigInteger() s.nextBigInteger s s.nextBigInteger() s.nextBigInteger s Arrays.sort(num, Collections.reverseOrder()) Arrays.sort Arrays num Collections.reverseOrder() Collections.reverseOrder Collections System.out.println(gcd(num) + " " + lcm(num)) System.out.println System.out System System.out gcd(num) + " " + lcm(num) gcd(num) + " " + lcm(num) gcd(num) gcd num " " lcm(num) lcm num String[] args args public static BigInteger gcd(BigInteger[] num) {
		return num[0].gcd(num[1]);
	} gcd {
		return num[0].gcd(num[1]);
	} return num[0].gcd(num[1]); num[0].gcd(num[1]) num[0].gcd num[0] num 0 num[1] num 1 BigInteger[] num num private static BigInteger lcm(BigInteger[] num) {
		return (num[0].multiply(num[1])).divide(gcd(num));
	} lcm {
		return (num[0].multiply(num[1])).divide(gcd(num));
	} return (num[0].multiply(num[1])).divide(gcd(num)); (num[0].multiply(num[1])).divide(gcd(num)) (num[0].multiply(num[1])).divide (num[0].multiply(num[1])) num[0].multiply num[0] num 0 num[1] num 1 gcd(num) gcd num BigInteger[] num num
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Scanner s = null;
		try {
			s = new Scanner(System.in);

			while (s.hasNextInt()) {
				BigInteger[] num = { s.nextBigInteger(), s.nextBigInteger() };
				Arrays.sort(num, Collections.reverseOrder());
				System.out.println(gcd(num) + " " + lcm(num));
			}

		} finally {
			s.close();
		}

	}

	public static BigInteger gcd(BigInteger[] num) {
		return num[0].gcd(num[1]);
	}

	private static BigInteger lcm(BigInteger[] num) {
		return (num[0].multiply(num[1])).divide(gcd(num));
	}
}