import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		long a;
		long b;

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

			System.out.println(gcd(a, b) + " " + lcm(a, b));
		}
	}

	public static long gcd(long a, long b) {
		long gcd = a;
		while(b % a != 0) {
			gcd = b % a;
			b = a;
			a = gcd;
		}
		return gcd;
	}

	public static long lcm(long a, long b) {
		return (a * b) / gcd(a, b);
	}


} import java.util.Scanner; Scanner java.util public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		long a;
		long b;

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

			System.out.println(gcd(a, b) + " " + lcm(a, b));
		}
	}

	public static long gcd(long a, long b) {
		long gcd = a;
		while(b % a != 0) {
			gcd = b % a;
			b = a;
			a = gcd;
		}
		return gcd;
	}

	public static long lcm(long a, long b) {
		return (a * b) / gcd(a, b);
	}


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

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

			System.out.println(gcd(a, b) + " " + lcm(a, b));
		}
	} main {
		long a;
		long b;

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

			System.out.println(gcd(a, b) + " " + lcm(a, b));
		}
	} long a; a long b; b while(sc.hasNext()) {
			a = sc.nextInt();
			b = sc.nextInt();

			System.out.println(gcd(a, b) + " " + lcm(a, b));
		} sc.hasNext() sc.hasNext sc {
			a = sc.nextInt();
			b = sc.nextInt();

			System.out.println(gcd(a, b) + " " + lcm(a, b));
		} a = sc.nextInt() a sc.nextInt() sc.nextInt sc b = sc.nextInt() b sc.nextInt() sc.nextInt sc System.out.println(gcd(a, b) + " " + lcm(a, b)) System.out.println System.out System System.out gcd(a, b) + " " + lcm(a, b) gcd(a, b) + " " + lcm(a, b) gcd(a, b) gcd a b " " lcm(a, b) lcm a b String[] args args public static long gcd(long a, long b) {
		long gcd = a;
		while(b % a != 0) {
			gcd = b % a;
			b = a;
			a = gcd;
		}
		return gcd;
	} gcd {
		long gcd = a;
		while(b % a != 0) {
			gcd = b % a;
			b = a;
			a = gcd;
		}
		return gcd;
	} long gcd = a; gcd a while(b % a != 0) {
			gcd = b % a;
			b = a;
			a = gcd;
		} b % a != 0 b % a b a 0 {
			gcd = b % a;
			b = a;
			a = gcd;
		} gcd = b % a gcd b % a b a b = a b a a = gcd a gcd return gcd; gcd long a a long b b public static long lcm(long a, long b) {
		return (a * b) / gcd(a, b);
	} lcm {
		return (a * b) / gcd(a, b);
	} return (a * b) / gcd(a, b); (a * b) / gcd(a, b) (a * b) a b gcd(a, b) gcd a b long a a long b b public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		long a;
		long b;

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

			System.out.println(gcd(a, b) + " " + lcm(a, b));
		}
	}

	public static long gcd(long a, long b) {
		long gcd = a;
		while(b % a != 0) {
			gcd = b % a;
			b = a;
			a = gcd;
		}
		return gcd;
	}

	public static long lcm(long a, long b) {
		return (a * b) / gcd(a, b);
	}


} public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		long a;
		long b;

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

			System.out.println(gcd(a, b) + " " + lcm(a, b));
		}
	}

	public static long gcd(long a, long b) {
		long gcd = a;
		while(b % a != 0) {
			gcd = b % a;
			b = a;
			a = gcd;
		}
		return gcd;
	}

	public static long lcm(long a, long b) {
		return (a * b) / gcd(a, b);
	}


} Main
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		long a;
		long b;

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

			System.out.println(gcd(a, b) + " " + lcm(a, b));
		}
	}

	public static long gcd(long a, long b) {
		long gcd = a;
		while(b % a != 0) {
			gcd = b % a;
			b = a;
			a = gcd;
		}
		return gcd;
	}

	public static long lcm(long a, long b) {
		return (a * b) / gcd(a, b);
	}


}