import java.util.Scanner;
class Main{
	public static int gcd(int m, int n) {
		if(n ==0){
			return m;
		}else{
			return gcd(n,m%n);
		}
	}
	public static long lcm(int m, int n){
		return (m / gcd(m, n)) * n; 
	}
    public static void main(String[] a){
    	
    	Scanner scan = new Scanner(System.in);
    	while (scan.hasNext()){ 
    	int n = 0;
    	int m = 0;
    	m = scan.nextInt();
    	n = scan.nextInt();
    	System.out.print(gcd(m,n) + " ");
    	System.out.println(lcm(m,n));
    	
    	}
 }
} import java.util.Scanner; Scanner java.util class Main{
	public static int gcd(int m, int n) {
		if(n ==0){
			return m;
		}else{
			return gcd(n,m%n);
		}
	}
	public static long lcm(int m, int n){
		return (m / gcd(m, n)) * n; 
	}
    public static void main(String[] a){
    	
    	Scanner scan = new Scanner(System.in);
    	while (scan.hasNext()){ 
    	int n = 0;
    	int m = 0;
    	m = scan.nextInt();
    	n = scan.nextInt();
    	System.out.print(gcd(m,n) + " ");
    	System.out.println(lcm(m,n));
    	
    	}
 }
} Main public static int gcd(int m, int n) {
		if(n ==0){
			return m;
		}else{
			return gcd(n,m%n);
		}
	} gcd {
		if(n ==0){
			return m;
		}else{
			return gcd(n,m%n);
		}
	} if(n ==0){
			return m;
		}else{
			return gcd(n,m%n);
		} n ==0 n 0 {
			return m;
		} return m; m {
			return gcd(n,m%n);
		} return gcd(n,m%n); gcd(n,m%n) gcd n m%n m n int m m int n n public static long lcm(int m, int n){
		return (m / gcd(m, n)) * n; 
	} lcm {
		return (m / gcd(m, n)) * n; 
	} return (m / gcd(m, n)) * n; (m / gcd(m, n)) * n (m / gcd(m, n)) m gcd(m, n) gcd m n n int m m int n n public static void main(String[] a){
    	
    	Scanner scan = new Scanner(System.in);
    	while (scan.hasNext()){ 
    	int n = 0;
    	int m = 0;
    	m = scan.nextInt();
    	n = scan.nextInt();
    	System.out.print(gcd(m,n) + " ");
    	System.out.println(lcm(m,n));
    	
    	}
 } main {
    	
    	Scanner scan = new Scanner(System.in);
    	while (scan.hasNext()){ 
    	int n = 0;
    	int m = 0;
    	m = scan.nextInt();
    	n = scan.nextInt();
    	System.out.print(gcd(m,n) + " ");
    	System.out.println(lcm(m,n));
    	
    	}
 } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) while (scan.hasNext()){ 
    	int n = 0;
    	int m = 0;
    	m = scan.nextInt();
    	n = scan.nextInt();
    	System.out.print(gcd(m,n) + " ");
    	System.out.println(lcm(m,n));
    	
    	} scan.hasNext() scan.hasNext scan { 
    	int n = 0;
    	int m = 0;
    	m = scan.nextInt();
    	n = scan.nextInt();
    	System.out.print(gcd(m,n) + " ");
    	System.out.println(lcm(m,n));
    	
    	} int n = 0; n 0 int m = 0; m 0 m = scan.nextInt() m scan.nextInt() scan.nextInt scan n = scan.nextInt() n scan.nextInt() scan.nextInt scan System.out.print(gcd(m,n) + " ") System.out.print System.out System System.out gcd(m,n) + " " gcd(m,n) gcd m n " " System.out.println(lcm(m,n)) System.out.println System.out System System.out lcm(m,n) lcm m n String[] a a
import java.util.Scanner;
class Main{
	public static int gcd(int m, int n) {
		if(n ==0){
			return m;
		}else{
			return gcd(n,m%n);
		}
	}
	public static long lcm(int m, int n){
		return (m / gcd(m, n)) * n; 
	}
    public static void main(String[] a){
    	
    	Scanner scan = new Scanner(System.in);
    	while (scan.hasNext()){ 
    	int n = 0;
    	int m = 0;
    	m = scan.nextInt();
    	n = scan.nextInt();
    	System.out.print(gcd(m,n) + " ");
    	System.out.println(lcm(m,n));
    	
    	}
 }
}