import java.util.*;
import java.lang.*;
import java.math.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	void run(){
		for(;;){
			if(!sc.hasNextInt()){
				break;
			}
			int a = sc.nextInt();
			int b = sc.nextInt();
			int ta = a;
			int tb = b; 
			for(;;){
				if(a==b)break;
				if(a>b){
					a-=b;
				}else{
					b-=a;
				}
				
			}
			int gcd =  a;
			int lcm = ta/a * tb;
			System.out.println(gcd + " "+lcm);
		}
		
	}
	public static void main(String[] args){
		Main m = new Main();
		m.run();
		
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.math.*; math.* java public class Main {
	Scanner sc = new Scanner(System.in);
	void run(){
		for(;;){
			if(!sc.hasNextInt()){
				break;
			}
			int a = sc.nextInt();
			int b = sc.nextInt();
			int ta = a;
			int tb = b; 
			for(;;){
				if(a==b)break;
				if(a>b){
					a-=b;
				}else{
					b-=a;
				}
				
			}
			int gcd =  a;
			int lcm = ta/a * tb;
			System.out.println(gcd + " "+lcm);
		}
		
	}
	public static void main(String[] args){
		Main m = new Main();
		m.run();
		
	}
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) void run(){
		for(;;){
			if(!sc.hasNextInt()){
				break;
			}
			int a = sc.nextInt();
			int b = sc.nextInt();
			int ta = a;
			int tb = b; 
			for(;;){
				if(a==b)break;
				if(a>b){
					a-=b;
				}else{
					b-=a;
				}
				
			}
			int gcd =  a;
			int lcm = ta/a * tb;
			System.out.println(gcd + " "+lcm);
		}
		
	} run {
		for(;;){
			if(!sc.hasNextInt()){
				break;
			}
			int a = sc.nextInt();
			int b = sc.nextInt();
			int ta = a;
			int tb = b; 
			for(;;){
				if(a==b)break;
				if(a>b){
					a-=b;
				}else{
					b-=a;
				}
				
			}
			int gcd =  a;
			int lcm = ta/a * tb;
			System.out.println(gcd + " "+lcm);
		}
		
	} for(;;){
			if(!sc.hasNextInt()){
				break;
			}
			int a = sc.nextInt();
			int b = sc.nextInt();
			int ta = a;
			int tb = b; 
			for(;;){
				if(a==b)break;
				if(a>b){
					a-=b;
				}else{
					b-=a;
				}
				
			}
			int gcd =  a;
			int lcm = ta/a * tb;
			System.out.println(gcd + " "+lcm);
		} ; {
			if(!sc.hasNextInt()){
				break;
			}
			int a = sc.nextInt();
			int b = sc.nextInt();
			int ta = a;
			int tb = b; 
			for(;;){
				if(a==b)break;
				if(a>b){
					a-=b;
				}else{
					b-=a;
				}
				
			}
			int gcd =  a;
			int lcm = ta/a * tb;
			System.out.println(gcd + " "+lcm);
		} {
			if(!sc.hasNextInt()){
				break;
			}
			int a = sc.nextInt();
			int b = sc.nextInt();
			int ta = a;
			int tb = b; 
			for(;;){
				if(a==b)break;
				if(a>b){
					a-=b;
				}else{
					b-=a;
				}
				
			}
			int gcd =  a;
			int lcm = ta/a * tb;
			System.out.println(gcd + " "+lcm);
		} if(!sc.hasNextInt()){
				break;
			} !sc.hasNextInt() sc.hasNextInt() sc.hasNextInt sc {
				break;
			} break; int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int ta = a; ta a int tb = b; tb b for(;;){
				if(a==b)break;
				if(a>b){
					a-=b;
				}else{
					b-=a;
				}
				
			} ; {
				if(a==b)break;
				if(a>b){
					a-=b;
				}else{
					b-=a;
				}
				
			} {
				if(a==b)break;
				if(a>b){
					a-=b;
				}else{
					b-=a;
				}
				
			} if(a==b)break; a==b a b break; if(a>b){
					a-=b;
				}else{
					b-=a;
				} a>b a b {
					a-=b;
				} a-=b a b {
					b-=a;
				} b-=a b a int gcd =  a; gcd a int lcm = ta/a * tb; lcm ta/a * tb ta/a ta a tb System.out.println(gcd + " "+lcm) System.out.println System.out System System.out gcd + " "+lcm gcd + " "+lcm gcd " " lcm public static void main(String[] args){
		Main m = new Main();
		m.run();
		
	} main {
		Main m = new Main();
		m.run();
		
	} Main m = new Main(); m new Main() m.run() m.run m String[] args args public class Main {
	Scanner sc = new Scanner(System.in);
	void run(){
		for(;;){
			if(!sc.hasNextInt()){
				break;
			}
			int a = sc.nextInt();
			int b = sc.nextInt();
			int ta = a;
			int tb = b; 
			for(;;){
				if(a==b)break;
				if(a>b){
					a-=b;
				}else{
					b-=a;
				}
				
			}
			int gcd =  a;
			int lcm = ta/a * tb;
			System.out.println(gcd + " "+lcm);
		}
		
	}
	public static void main(String[] args){
		Main m = new Main();
		m.run();
		
	}
} public class Main {
	Scanner sc = new Scanner(System.in);
	void run(){
		for(;;){
			if(!sc.hasNextInt()){
				break;
			}
			int a = sc.nextInt();
			int b = sc.nextInt();
			int ta = a;
			int tb = b; 
			for(;;){
				if(a==b)break;
				if(a>b){
					a-=b;
				}else{
					b-=a;
				}
				
			}
			int gcd =  a;
			int lcm = ta/a * tb;
			System.out.println(gcd + " "+lcm);
		}
		
	}
	public static void main(String[] args){
		Main m = new Main();
		m.run();
		
	}
} Main
import java.util.*;
import java.lang.*;
import java.math.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	void run(){
		for(;;){
			if(!sc.hasNextInt()){
				break;
			}
			int a = sc.nextInt();
			int b = sc.nextInt();
			int ta = a;
			int tb = b; 
			for(;;){
				if(a==b)break;
				if(a>b){
					a-=b;
				}else{
					b-=a;
				}
				
			}
			int gcd =  a;
			int lcm = ta/a * tb;
			System.out.println(gcd + " "+lcm);
		}
		
	}
	public static void main(String[] args){
		Main m = new Main();
		m.run();
		
	}
}