using System;
using System.Linq;
public class Test {
	public static int gcd(int x, int y) {
		if(y == 0) return x;
		return gcd(y, x % y);
	}
	public static int lcm(int x, int y) {
		return x / gcd(x, y) * y;
	}
	public static void Main() {
		string buf;
		while(!string.IsNullOrEmpty(buf = Console.ReadLine())) {
			string[] sc = buf.Split();
			int a = int.Parse(sc[0]), b = int.Parse(sc[1]);
			Console.WriteLine(gcd(a, b) + " " + lcm(a, b));
		}
	}
}