import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			long m = sc.nextLong();
			long n = sc.nextLong();
			
			System.out.printf("%d %d\n",gcd(m, n), lcm(m, n));
		}
	}
	
	public static long gcd(long a, long b){
		
		if(b == 0)	return a;
		else return gcd(b, a % b);
	}
	
	public static long lcm(long a, long b){
		return a * b / gcd(a, b);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			long m = sc.nextLong();
			long n = sc.nextLong();
			
			System.out.printf("%d %d\n",gcd(m, n), lcm(m, n));
		}
	}
	
	public static long gcd(long a, long b){
		
		if(b == 0)	return a;
		else return gcd(b, a % b);
	}
	
	public static long lcm(long a, long b){
		return a * b / gcd(a, b);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			long m = sc.nextLong();
			long n = sc.nextLong();
			
			System.out.printf("%d %d\n",gcd(m, n), lcm(m, n));
		}
	} main {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			long m = sc.nextLong();
			long n = sc.nextLong();
			
			System.out.printf("%d %d\n",gcd(m, n), lcm(m, n));
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(sc.hasNext()){
			long m = sc.nextLong();
			long n = sc.nextLong();
			
			System.out.printf("%d %d\n",gcd(m, n), lcm(m, n));
		} sc.hasNext() sc.hasNext sc {
			long m = sc.nextLong();
			long n = sc.nextLong();
			
			System.out.printf("%d %d\n",gcd(m, n), lcm(m, n));
		} long m = sc.nextLong(); m sc.nextLong() sc.nextLong sc long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc System.out.printf("%d %d\n",gcd(m, n), lcm(m, n)) System.out.printf System.out System System.out "%d %d\n" gcd(m, n) gcd m n lcm(m, n) lcm m n String[] args args public 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 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 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			long m = sc.nextLong();
			long n = sc.nextLong();
			
			System.out.printf("%d %d\n",gcd(m, n), lcm(m, n));
		}
	}
	
	public static long gcd(long a, long b){
		
		if(b == 0)	return a;
		else return gcd(b, a % b);
	}
	
	public static long lcm(long a, long b){
		return a * b / gcd(a, b);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			long m = sc.nextLong();
			long n = sc.nextLong();
			
			System.out.printf("%d %d\n",gcd(m, n), lcm(m, n));
		}
	}
	
	public static long gcd(long a, long b){
		
		if(b == 0)	return a;
		else return gcd(b, a % b);
	}
	
	public static long lcm(long a, long b){
		return a * b / gcd(a, b);
	}
} Main
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			long m = sc.nextLong();
			long n = sc.nextLong();
			
			System.out.printf("%d %d\n",gcd(m, n), lcm(m, n));
		}
	}
	
	public static long gcd(long a, long b){
		
		if(b == 0)	return a;
		else return gcd(b, a % b);
	}
	
	public static long lcm(long a, long b){
		return a * b / gcd(a, b);
	}
}