import java.util.Scanner;

class Main {

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

			while (s.hasNextLong()) {
				long[] num = { s.nextLong(), s.nextLong() };
				System.out.println(gcd(num) + " " + lcm(num));
			}

		} finally {
			s.close();
		}

	}

	// ?????????????????????????????????
	// ??§??????????????°??????????????????????????°?????§?????£?????????
	// ??°??????0????????£?????¨??????????????????????????°???????????§??¬?´???°
	private static long gcd(long[] num) {

		long x = 0;
		long a = num[0];
		long b = num[1];
		do {
			x = a % b;
			a = b;
			b = x;
		} while (x != 0);

		return a;

	}

	 //2????????°?????????????????????????????§??¬?´???°??§?????£?????°??????
	 //????°???¬?????°
	 private static long lcm(long[] num) {
	 return (num[0] * num[1]) / gcd(num);
	 }
} 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.hasNextLong()) {
				long[] num = { s.nextLong(), s.nextLong() };
				System.out.println(gcd(num) + " " + lcm(num));
			}

		} finally {
			s.close();
		}

	}

	// ?????????????????????????????????
	// ??§??????????????°??????????????????????????°?????§?????£?????????
	// ??°??????0????????£?????¨??????????????????????????°???????????§??¬?´???°
	private static long gcd(long[] num) {

		long x = 0;
		long a = num[0];
		long b = num[1];
		do {
			x = a % b;
			a = b;
			b = x;
		} while (x != 0);

		return a;

	}

	 //2????????°?????????????????????????????§??¬?´???°??§?????£?????°??????
	 //????°???¬?????°
	 private static long lcm(long[] num) {
	 return (num[0] * num[1]) / gcd(num);
	 }
} Main public static void main(String[] args) {
		Scanner s = null;
		try {
			s = new Scanner(System.in);

			while (s.hasNextLong()) {
				long[] num = { s.nextLong(), s.nextLong() };
				System.out.println(gcd(num) + " " + lcm(num));
			}

		} finally {
			s.close();
		}

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

			while (s.hasNextLong()) {
				long[] num = { s.nextLong(), s.nextLong() };
				System.out.println(gcd(num) + " " + lcm(num));
			}

		} finally {
			s.close();
		}

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

			while (s.hasNextLong()) {
				long[] num = { s.nextLong(), s.nextLong() };
				System.out.println(gcd(num) + " " + lcm(num));
			}

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

			while (s.hasNextLong()) {
				long[] num = { s.nextLong(), s.nextLong() };
				System.out.println(gcd(num) + " " + lcm(num));
			}

		} s = new Scanner(System.in) s new Scanner(System.in) while (s.hasNextLong()) {
				long[] num = { s.nextLong(), s.nextLong() };
				System.out.println(gcd(num) + " " + lcm(num));
			} s.hasNextLong() s.hasNextLong s {
				long[] num = { s.nextLong(), s.nextLong() };
				System.out.println(gcd(num) + " " + lcm(num));
			} long[] num = { s.nextLong(), s.nextLong() }; num { s.nextLong(), s.nextLong() } s.nextLong() s.nextLong s s.nextLong() s.nextLong s 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 // ?????????????????????????????????
	// ??§??????????????°??????????????????????????°?????§?????£?????????
	// ??°??????0????????£?????¨??????????????????????????°???????????§??¬?´???°
	private static long gcd(long[] num) {

		long x = 0;
		long a = num[0];
		long b = num[1];
		do {
			x = a % b;
			a = b;
			b = x;
		} while (x != 0);

		return a;

	} gcd {

		long x = 0;
		long a = num[0];
		long b = num[1];
		do {
			x = a % b;
			a = b;
			b = x;
		} while (x != 0);

		return a;

	} long x = 0; x 0 long a = num[0]; a num[0] num 0 long b = num[1]; b num[1] num 1 do {
			x = a % b;
			a = b;
			b = x;
		} while (x != 0); x != 0 x 0 {
			x = a % b;
			a = b;
			b = x;
		} x = a % b x a % b a b a = b a b b = x b x return a; a long[] num num //2????????°?????????????????????????????§??¬?´???°??§?????£?????°??????
	 //????°???¬?????°
	 private static long lcm(long[] num) {
	 return (num[0] * num[1]) / gcd(num);
	 } lcm {
	 return (num[0] * num[1]) / gcd(num);
	 } return (num[0] * num[1]) / gcd(num); (num[0] * num[1]) / gcd(num) (num[0] * num[1]) num[0] num 0 num[1] num 1 gcd(num) gcd num long[] num num
import java.util.Scanner;

class Main {

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

			while (s.hasNextLong()) {
				long[] num = { s.nextLong(), s.nextLong() };
				System.out.println(gcd(num) + " " + lcm(num));
			}

		} finally {
			s.close();
		}

	}

	// ?????????????????????????????????
	// ??§??????????????°??????????????????????????°?????§?????£?????????
	// ??°??????0????????£?????¨??????????????????????????°???????????§??¬?´???°
	private static long gcd(long[] num) {

		long x = 0;
		long a = num[0];
		long b = num[1];
		do {
			x = a % b;
			a = b;
			b = x;
		} while (x != 0);

		return a;

	}

	 //2????????°?????????????????????????????§??¬?´???°??§?????£?????°??????
	 //????°???¬?????°
	 private static long lcm(long[] num) {
	 return (num[0] * num[1]) / gcd(num);
	 }
}