import java.util.Scanner;


public class Main {
	Scanner sc = new Scanner(System.in);
	
	void run(){
		while(sc.hasNext()){
			long a, ta, b, tb, gcd, lcm;
			a = ta = sc.nextLong();
			b = tb = sc.nextLong();
			gcd = lcm = 1;
			
			int d = 2;
			
			
			while(true){
				if(ta / d == 0 || tb / d == 0)
					break;
				
				if(ta % d == 0 && tb % d == 0){
					gcd *= d;
					ta /= d;
					tb /= d;
				}else{
					d++;
				}
			}
			
			lcm = a * b / gcd;
			
			System.out.printf("%d %d\n", gcd, lcm);
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	Scanner sc = new Scanner(System.in);
	
	void run(){
		while(sc.hasNext()){
			long a, ta, b, tb, gcd, lcm;
			a = ta = sc.nextLong();
			b = tb = sc.nextLong();
			gcd = lcm = 1;
			
			int d = 2;
			
			
			while(true){
				if(ta / d == 0 || tb / d == 0)
					break;
				
				if(ta % d == 0 && tb % d == 0){
					gcd *= d;
					ta /= d;
					tb /= d;
				}else{
					d++;
				}
			}
			
			lcm = a * b / gcd;
			
			System.out.printf("%d %d\n", gcd, lcm);
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) void run(){
		while(sc.hasNext()){
			long a, ta, b, tb, gcd, lcm;
			a = ta = sc.nextLong();
			b = tb = sc.nextLong();
			gcd = lcm = 1;
			
			int d = 2;
			
			
			while(true){
				if(ta / d == 0 || tb / d == 0)
					break;
				
				if(ta % d == 0 && tb % d == 0){
					gcd *= d;
					ta /= d;
					tb /= d;
				}else{
					d++;
				}
			}
			
			lcm = a * b / gcd;
			
			System.out.printf("%d %d\n", gcd, lcm);
		}
	} run {
		while(sc.hasNext()){
			long a, ta, b, tb, gcd, lcm;
			a = ta = sc.nextLong();
			b = tb = sc.nextLong();
			gcd = lcm = 1;
			
			int d = 2;
			
			
			while(true){
				if(ta / d == 0 || tb / d == 0)
					break;
				
				if(ta % d == 0 && tb % d == 0){
					gcd *= d;
					ta /= d;
					tb /= d;
				}else{
					d++;
				}
			}
			
			lcm = a * b / gcd;
			
			System.out.printf("%d %d\n", gcd, lcm);
		}
	} while(sc.hasNext()){
			long a, ta, b, tb, gcd, lcm;
			a = ta = sc.nextLong();
			b = tb = sc.nextLong();
			gcd = lcm = 1;
			
			int d = 2;
			
			
			while(true){
				if(ta / d == 0 || tb / d == 0)
					break;
				
				if(ta % d == 0 && tb % d == 0){
					gcd *= d;
					ta /= d;
					tb /= d;
				}else{
					d++;
				}
			}
			
			lcm = a * b / gcd;
			
			System.out.printf("%d %d\n", gcd, lcm);
		} sc.hasNext() sc.hasNext sc {
			long a, ta, b, tb, gcd, lcm;
			a = ta = sc.nextLong();
			b = tb = sc.nextLong();
			gcd = lcm = 1;
			
			int d = 2;
			
			
			while(true){
				if(ta / d == 0 || tb / d == 0)
					break;
				
				if(ta % d == 0 && tb % d == 0){
					gcd *= d;
					ta /= d;
					tb /= d;
				}else{
					d++;
				}
			}
			
			lcm = a * b / gcd;
			
			System.out.printf("%d %d\n", gcd, lcm);
		} long a a ta ta b b tb tb gcd gcd lcm; lcm a = ta = sc.nextLong() a ta = sc.nextLong() ta sc.nextLong() sc.nextLong sc b = tb = sc.nextLong() b tb = sc.nextLong() tb sc.nextLong() sc.nextLong sc gcd = lcm = 1 gcd lcm = 1 lcm 1 int d = 2; d 2 while(true){
				if(ta / d == 0 || tb / d == 0)
					break;
				
				if(ta % d == 0 && tb % d == 0){
					gcd *= d;
					ta /= d;
					tb /= d;
				}else{
					d++;
				}
			} true {
				if(ta / d == 0 || tb / d == 0)
					break;
				
				if(ta % d == 0 && tb % d == 0){
					gcd *= d;
					ta /= d;
					tb /= d;
				}else{
					d++;
				}
			} if(ta / d == 0 || tb / d == 0)
					break; ta / d == 0 || tb / d == 0 ta / d == 0 ta / d ta d 0 tb / d == 0 tb / d tb d 0 break; if(ta % d == 0 && tb % d == 0){
					gcd *= d;
					ta /= d;
					tb /= d;
				}else{
					d++;
				} ta % d == 0 && tb % d == 0 ta % d == 0 ta % d ta d 0 tb % d == 0 tb % d tb d 0 {
					gcd *= d;
					ta /= d;
					tb /= d;
				} gcd *= d gcd d ta /= d ta d tb /= d tb d {
					d++;
				} d++ d lcm = a * b / gcd lcm a * b / gcd a * b a b gcd System.out.printf("%d %d\n", gcd, lcm) System.out.printf System.out System System.out "%d %d\n" gcd lcm public static void main(String[] args) {
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String[] args args public class Main {
	Scanner sc = new Scanner(System.in);
	
	void run(){
		while(sc.hasNext()){
			long a, ta, b, tb, gcd, lcm;
			a = ta = sc.nextLong();
			b = tb = sc.nextLong();
			gcd = lcm = 1;
			
			int d = 2;
			
			
			while(true){
				if(ta / d == 0 || tb / d == 0)
					break;
				
				if(ta % d == 0 && tb % d == 0){
					gcd *= d;
					ta /= d;
					tb /= d;
				}else{
					d++;
				}
			}
			
			lcm = a * b / gcd;
			
			System.out.printf("%d %d\n", gcd, lcm);
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
} public class Main {
	Scanner sc = new Scanner(System.in);
	
	void run(){
		while(sc.hasNext()){
			long a, ta, b, tb, gcd, lcm;
			a = ta = sc.nextLong();
			b = tb = sc.nextLong();
			gcd = lcm = 1;
			
			int d = 2;
			
			
			while(true){
				if(ta / d == 0 || tb / d == 0)
					break;
				
				if(ta % d == 0 && tb % d == 0){
					gcd *= d;
					ta /= d;
					tb /= d;
				}else{
					d++;
				}
			}
			
			lcm = a * b / gcd;
			
			System.out.printf("%d %d\n", gcd, lcm);
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
} Main
import java.util.Scanner;


public class Main {
	Scanner sc = new Scanner(System.in);
	
	void run(){
		while(sc.hasNext()){
			long a, ta, b, tb, gcd, lcm;
			a = ta = sc.nextLong();
			b = tb = sc.nextLong();
			gcd = lcm = 1;
			
			int d = 2;
			
			
			while(true){
				if(ta / d == 0 || tb / d == 0)
					break;
				
				if(ta % d == 0 && tb % d == 0){
					gcd *= d;
					ta /= d;
					tb /= d;
				}else{
					d++;
				}
			}
			
			lcm = a * b / gcd;
			
			System.out.printf("%d %d\n", gcd, lcm);
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}