import java.util.Scanner;

public class Main {

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

		while(sc.hasNext()) {
			int a = sc.nextInt();
			int b = sc.nextInt();

			System.out.printf("%d %d\n",gcd(a, b) ,lcm(a, b));
		}
		sc.close();

	}

	private static long lcm(int i, int j) {
		long lcm = i / gcd(i, j) * j;
		return lcm;
	}

	private static int gcd(int x, int y) {
		int x_tmp = 0;

		do {
			x_tmp = x;

			x = y;
			y = x_tmp % y;
		}while(y > 0);

		int gcd = x;

		return gcd;
	}

} import java.util.Scanner; Scanner java.util public class Main {

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

		while(sc.hasNext()) {
			int a = sc.nextInt();
			int b = sc.nextInt();

			System.out.printf("%d %d\n",gcd(a, b) ,lcm(a, b));
		}
		sc.close();

	}

	private static long lcm(int i, int j) {
		long lcm = i / gcd(i, j) * j;
		return lcm;
	}

	private static int gcd(int x, int y) {
		int x_tmp = 0;

		do {
			x_tmp = x;

			x = y;
			y = x_tmp % y;
		}while(y > 0);

		int gcd = x;

		return gcd;
	}

} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {

		while(sc.hasNext()) {
			int a = sc.nextInt();
			int b = sc.nextInt();

			System.out.printf("%d %d\n",gcd(a, b) ,lcm(a, b));
		}
		sc.close();

	} main {

		while(sc.hasNext()) {
			int a = sc.nextInt();
			int b = sc.nextInt();

			System.out.printf("%d %d\n",gcd(a, b) ,lcm(a, b));
		}
		sc.close();

	} while(sc.hasNext()) {
			int a = sc.nextInt();
			int b = sc.nextInt();

			System.out.printf("%d %d\n",gcd(a, b) ,lcm(a, b));
		} sc.hasNext() sc.hasNext sc {
			int a = sc.nextInt();
			int b = sc.nextInt();

			System.out.printf("%d %d\n",gcd(a, b) ,lcm(a, b));
		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc System.out.printf("%d %d\n",gcd(a, b) ,lcm(a, b)) System.out.printf System.out System System.out "%d %d\n" gcd(a, b) gcd a b lcm(a, b) lcm a b sc.close() sc.close sc String[] args args private static long lcm(int i, int j) {
		long lcm = i / gcd(i, j) * j;
		return lcm;
	} lcm {
		long lcm = i / gcd(i, j) * j;
		return lcm;
	} long lcm = i / gcd(i, j) * j; lcm i / gcd(i, j) * j i / gcd(i, j) i gcd(i, j) gcd i j j return lcm; lcm int i i int j j private static int gcd(int x, int y) {
		int x_tmp = 0;

		do {
			x_tmp = x;

			x = y;
			y = x_tmp % y;
		}while(y > 0);

		int gcd = x;

		return gcd;
	} gcd {
		int x_tmp = 0;

		do {
			x_tmp = x;

			x = y;
			y = x_tmp % y;
		}while(y > 0);

		int gcd = x;

		return gcd;
	} int x_tmp = 0; x_tmp 0 do {
			x_tmp = x;

			x = y;
			y = x_tmp % y;
		}while(y > 0); y > 0 y 0 {
			x_tmp = x;

			x = y;
			y = x_tmp % y;
		} x_tmp = x x_tmp x x = y x y y = x_tmp % y y x_tmp % y x_tmp y int gcd = x; gcd x return gcd; gcd int x x int y y public class Main {

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

		while(sc.hasNext()) {
			int a = sc.nextInt();
			int b = sc.nextInt();

			System.out.printf("%d %d\n",gcd(a, b) ,lcm(a, b));
		}
		sc.close();

	}

	private static long lcm(int i, int j) {
		long lcm = i / gcd(i, j) * j;
		return lcm;
	}

	private static int gcd(int x, int y) {
		int x_tmp = 0;

		do {
			x_tmp = x;

			x = y;
			y = x_tmp % y;
		}while(y > 0);

		int gcd = x;

		return gcd;
	}

} public class Main {

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

		while(sc.hasNext()) {
			int a = sc.nextInt();
			int b = sc.nextInt();

			System.out.printf("%d %d\n",gcd(a, b) ,lcm(a, b));
		}
		sc.close();

	}

	private static long lcm(int i, int j) {
		long lcm = i / gcd(i, j) * j;
		return lcm;
	}

	private static int gcd(int x, int y) {
		int x_tmp = 0;

		do {
			x_tmp = x;

			x = y;
			y = x_tmp % y;
		}while(y > 0);

		int gcd = x;

		return gcd;
	}

} Main
import java.util.Scanner;

public class Main {

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

		while(sc.hasNext()) {
			int a = sc.nextInt();
			int b = sc.nextInt();

			System.out.printf("%d %d\n",gcd(a, b) ,lcm(a, b));
		}
		sc.close();

	}

	private static long lcm(int i, int j) {
		long lcm = i / gcd(i, j) * j;
		return lcm;
	}

	private static int gcd(int x, int y) {
		int x_tmp = 0;

		do {
			x_tmp = x;

			x = y;
			y = x_tmp % y;
		}while(y > 0);

		int gcd = x;

		return gcd;
	}

}
