import java.util.Scanner;

public class Main {
	static long a,b;
	static Scanner cin = new Scanner(System.in);
	public static void main(String[] args) {
		while(read()){
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	private static boolean read() {
		if(!cin.hasNext())
        	return false;
        a = cin.nextLong();
        b = cin.nextLong();
		return true;
	}

	private static long gcd(long a, long b) {
		if(b == 0)
			return a;
		else
			return gcd(b,a%b);
	}

	private static long lcm(long a, long b) {
		return a*b/gcd(a,b);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	static long a,b;
	static Scanner cin = new Scanner(System.in);
	public static void main(String[] args) {
		while(read()){
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	private static boolean read() {
		if(!cin.hasNext())
        	return false;
        a = cin.nextLong();
        b = cin.nextLong();
		return true;
	}

	private static long gcd(long a, long b) {
		if(b == 0)
			return a;
		else
			return gcd(b,a%b);
	}

	private static long lcm(long a, long b) {
		return a*b/gcd(a,b);
	}
} Main static long a a b; b static Scanner cin = new Scanner(System.in); cin new Scanner(System.in) public static void main(String[] args) {
		while(read()){
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	} main {
		while(read()){
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	} while(read()){
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		} read() read {
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		} 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 private static boolean read() {
		if(!cin.hasNext())
        	return false;
        a = cin.nextLong();
        b = cin.nextLong();
		return true;
	} read {
		if(!cin.hasNext())
        	return false;
        a = cin.nextLong();
        b = cin.nextLong();
		return true;
	} if(!cin.hasNext())
        	return false; !cin.hasNext() cin.hasNext() cin.hasNext cin return false; false a = cin.nextLong() a cin.nextLong() cin.nextLong cin b = cin.nextLong() b cin.nextLong() cin.nextLong cin return true; true private static long gcd(long a, long b) {
		if(b == 0)
			return a;
		else
			return gcd(b,a%b);
	} gcd {
		if(b == 0)
			return a;
		else
			return gcd(b,a%b);
	} if(b == 0)
			return a;
		else
			return gcd(b,a%b); b == 0 b 0 return a; a return gcd(b,a%b); gcd(b,a%b) gcd b a%b a b long a a long b b private 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 long a,b;
	static Scanner cin = new Scanner(System.in);
	public static void main(String[] args) {
		while(read()){
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	private static boolean read() {
		if(!cin.hasNext())
        	return false;
        a = cin.nextLong();
        b = cin.nextLong();
		return true;
	}

	private static long gcd(long a, long b) {
		if(b == 0)
			return a;
		else
			return gcd(b,a%b);
	}

	private static long lcm(long a, long b) {
		return a*b/gcd(a,b);
	}
} public class Main {
	static long a,b;
	static Scanner cin = new Scanner(System.in);
	public static void main(String[] args) {
		while(read()){
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	private static boolean read() {
		if(!cin.hasNext())
        	return false;
        a = cin.nextLong();
        b = cin.nextLong();
		return true;
	}

	private static long gcd(long a, long b) {
		if(b == 0)
			return a;
		else
			return gcd(b,a%b);
	}

	private static long lcm(long a, long b) {
		return a*b/gcd(a,b);
	}
} Main
import java.util.Scanner;

public class Main {
	static long a,b;
	static Scanner cin = new Scanner(System.in);
	public static void main(String[] args) {
		while(read()){
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	private static boolean read() {
		if(!cin.hasNext())
        	return false;
        a = cin.nextLong();
        b = cin.nextLong();
		return true;
	}

	private static long gcd(long a, long b) {
		if(b == 0)
			return a;
		else
			return gcd(b,a%b);
	}

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